mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
Gadgeteer [recipe] (#3399)
* gadgeteer [recipe] * Minor changes * Minor changes * Add slash * Add additional files * Fix http -> https * Update additional-files * Remove rdef from patch * Remove tab * Remove tracker * gadgeteer: regenerate patchset to avoid some warnings. * Add libyaml * Move command to correct location * Don't remove files in the patchset.
This commit is contained in:
committed by
Jérôme Duval
parent
3629566e40
commit
51e2409fd6
16
haiku-misc/gadgeteer/additional-files/gadgeteer.rdef.in
Normal file
16
haiku-misc/gadgeteer/additional-files/gadgeteer.rdef.in
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
resource app_signature "application/x-vnd.pjg-gadgeteer";
|
||||
|
||||
resource app_version {
|
||||
major = @MAJOR@,
|
||||
middle = @MIDDLE@,
|
||||
minor = @MINOR@,
|
||||
|
||||
variety = B_APPV_BETA,
|
||||
internal = 0,
|
||||
|
||||
short_info = "Command Line GUI Interface",
|
||||
long_info = "Display GUI controls from the command-line or shell-script"
|
||||
};
|
||||
|
||||
resource file_types message;
|
||||
58
haiku-misc/gadgeteer/gadgeteer-0.8.1.recipe
Normal file
58
haiku-misc/gadgeteer/gadgeteer-0.8.1.recipe
Normal file
@@ -0,0 +1,58 @@
|
||||
SUMMARY="Command line for creating GUI forms"
|
||||
DESCRIPTION="Gadgeteer is a command line app for creating small GUI forms \
|
||||
that users can fill out or play with. Once the users press the \"DONE\" \
|
||||
button at the bottom of the screen, the command returns the user's input \
|
||||
values so they could be used for different purposes."
|
||||
HOMEPAGE="https://www.goodeveca.net/beos/"
|
||||
COPYRIGHT="2016 Pete Goodeve
|
||||
2006 Kirill Simonov"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://www.goodeveca.net/beos/Gadgeteer_${portVersion}_SRC.zip"
|
||||
CHECKSUM_SHA256="9e7b200b157dba04946c786d9205aed3c0dfff50936fa01b2cbaf71683187965"
|
||||
SOURCE_DIR="SRC"
|
||||
PATCHES="gadgeteer-$portVersion.patchset"
|
||||
ADDITIONAL_FILES="gadgeteer.rdef.in"
|
||||
|
||||
ARCHITECTURES="x86_gcc2 !x86_64"
|
||||
|
||||
PROVIDES="
|
||||
gadgeteer = $portVersion
|
||||
cmd:gadgeteer = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
lib:libyaml
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
devel:libyaml
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
makefile_engine
|
||||
cmd:cc
|
||||
cmd:make
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
|
||||
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
|
||||
local MINOR="`echo "$portVersion" | cut -d. -f3`"
|
||||
|
||||
sed \
|
||||
-e "s|@MAJOR@|$MAJOR|" \
|
||||
-e "s|@MIDDLE@|$MIDDLE|" \
|
||||
-e "s|@MINOR@|$MINOR|" \
|
||||
"$portDir"/additional-files/gadgeteer.rdef.in \
|
||||
> gadgeteer.rdef
|
||||
|
||||
make OBJ_DIR=objects
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
mkdir -p $binDir
|
||||
cp objects/gadgeteer $binDir
|
||||
}
|
||||
252
haiku-misc/gadgeteer/patches/gadgeteer-0.8.1.patchset
Normal file
252
haiku-misc/gadgeteer/patches/gadgeteer-0.8.1.patchset
Normal file
@@ -0,0 +1,252 @@
|
||||
From 162946f20eda5fe3422a52cd5e33af88c40029b5 Mon Sep 17 00:00:00 2001
|
||||
From: Bach Nguyen <bach5000@gmail.com>
|
||||
Date: Mon, 19 Nov 2018 19:25:49 +0000
|
||||
Subject: Fix build
|
||||
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 9b4cc30..8e66ddf 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1 +1,131 @@
|
||||
-Makefile_RELEASE
|
||||
\ No newline at end of file
|
||||
+## Haiku Generic Makefile v2.6 ##
|
||||
+
|
||||
+## Fill in this file to specify the project being created, and the referenced
|
||||
+## Makefile-Engine will do all of the hard work for you. This handles any
|
||||
+## architecture of Haiku.
|
||||
+
|
||||
+# The name of the binary.
|
||||
+NAME = gadgeteer
|
||||
+
|
||||
+# The type of binary, must be one of:
|
||||
+# APP: Application
|
||||
+# SHARED: Shared library or add-on
|
||||
+# STATIC: Static library archive
|
||||
+# DRIVER: Kernel driver
|
||||
+TYPE = APP
|
||||
+
|
||||
+# If you plan to use localization, specify the application's MIME signature.
|
||||
+APP_MIME_SIG =
|
||||
+
|
||||
+# The following lines tell Pe and Eddie where the SRCS, RDEFS, and RSRCS are
|
||||
+# so that Pe and Eddie can fill them in for you.
|
||||
+#%{
|
||||
+# @src->@
|
||||
+
|
||||
+# Specify the source files to use. Full paths or paths relative to the
|
||||
+# Makefile can be included. All files, regardless of directory, will have
|
||||
+# their object files created in the common object directory. Note that this
|
||||
+# means this Makefile will not work correctly if two source files with the
|
||||
+# same name (source.c or source.cpp) are included from different directories.
|
||||
+# Also note that spaces in folder names do not work well with this Makefile.
|
||||
+SRCS = Main.cpp \
|
||||
+ Panel.cpp \
|
||||
+ ReadYaml.cpp \
|
||||
+ WMPanel.cpp \
|
||||
+ WMSlider.cpp \
|
||||
+
|
||||
+# Specify the resource definition files to use. Full or relative paths can be
|
||||
+# used.
|
||||
+RDEFS = gadgeteer.rdef
|
||||
+
|
||||
+
|
||||
+
|
||||
+# Specify the resource files to use. Full or relative paths can be used.
|
||||
+# Both RDEFS and RSRCS can be utilized in the same Makefile.
|
||||
+RSRCS =
|
||||
+
|
||||
+
|
||||
+# End Pe/Eddie support.
|
||||
+# @<-src@
|
||||
+#%}
|
||||
+
|
||||
+#%}
|
||||
+
|
||||
+# Specify libraries to link against.
|
||||
+# There are two acceptable forms of library specifications:
|
||||
+# - if your library follows the naming pattern of libXXX.so or libXXX.a,
|
||||
+# you can simply specify XXX for the library. (e.g. the entry for
|
||||
+# "libtracker.so" would be "tracker")
|
||||
+#
|
||||
+# - for GCC-independent linking of standard C++ libraries, you can use
|
||||
+# $(STDCPPLIBS) instead of the raw "stdc++[.r4] [supc++]" library names.
|
||||
+#
|
||||
+# - if your library does not follow the standard library naming scheme,
|
||||
+# you need to specify the path to the library and it's name.
|
||||
+# (e.g. for mylib.a, specify "mylib.a" or "path/mylib.a")
|
||||
+LIBS = $(STDCPPLIBS) be root libyaml.a
|
||||
+# Specify additional paths to directories following the standard libXXX.so
|
||||
+# or libXXX.a naming scheme. You can specify full paths or paths relative
|
||||
+# to the Makefile. The paths included are not parsed recursively, so
|
||||
+# include all of the paths where libraries must be found. Directories where
|
||||
+# source files were specified are automatically included.
|
||||
+LIBPATHS =
|
||||
+
|
||||
+# Additional paths to look for system headers. These use the form
|
||||
+# "#include <header>". Directories that contain the files in SRCS are
|
||||
+# NOT auto-included here.
|
||||
+SYSTEM_INCLUDE_PATHS =
|
||||
+
|
||||
+# Additional paths paths to look for local headers. These use the form
|
||||
+# #include "header". Directories that contain the files in SRCS are
|
||||
+# automatically included.
|
||||
+LOCAL_INCLUDE_PATHS =
|
||||
+
|
||||
+# Specify the level of optimization that you want. Specify either NONE (O0),
|
||||
+# SOME (O1), FULL (O2), or leave blank (for the default optimization level).
|
||||
+OPTIMIZE :=
|
||||
+
|
||||
+# Specify the codes for languages you are going to support in this
|
||||
+# application. The default "en" one must be provided too. "make catkeys"
|
||||
+# will recreate only the "locales/en.catkeys" file. Use it as a template
|
||||
+# for creating catkeys for other languages. All localization files must be
|
||||
+# placed in the "locales" subdirectory.
|
||||
+LOCALES =
|
||||
+
|
||||
+# Specify all the preprocessor symbols to be defined. The symbols will not
|
||||
+# have their values set automatically; you must supply the value (if any) to
|
||||
+# use. For example, setting DEFINES to "DEBUG=1" will cause the compiler
|
||||
+# option "-DDEBUG=1" to be used. Setting DEFINES to "DEBUG" would pass
|
||||
+# "-DDEBUG" on the compiler's command line.
|
||||
+DEFINES =
|
||||
+
|
||||
+# Specify the warning level. Either NONE (suppress all warnings),
|
||||
+# ALL (enable all warnings), or leave blank (enable default warnings).
|
||||
+WARNINGS =
|
||||
+
|
||||
+# With image symbols, stack crawls in the debugger are meaningful.
|
||||
+# If set to "TRUE", symbols will be created.
|
||||
+SYMBOLS :=
|
||||
+
|
||||
+# Includes debug information, which allows the binary to be debugged easily.
|
||||
+# If set to "TRUE", debug info will be created.
|
||||
+DEBUGGER :=
|
||||
+
|
||||
+# Specify any additional compiler flags to be used.
|
||||
+COMPILER_FLAGS = -fpermissive
|
||||
+
|
||||
+# Specify any additional linker flags to be used.
|
||||
+LINKER_FLAGS =
|
||||
+
|
||||
+# (Only used when "TYPE" is "DRIVER"). Specify the desired driver install
|
||||
+# location in the /dev hierarchy. Example:
|
||||
+# DRIVER_PATH = video/usb
|
||||
+# will instruct the "driverinstall" rule to place a symlink to your driver's
|
||||
+# binary in ~/add-ons/kernel/drivers/dev/video/usb, so that your driver will
|
||||
+# appear at /dev/video/usb when loaded. The default is "misc".
|
||||
+DRIVER_PATH =
|
||||
+
|
||||
+## Include the Makefile-Engine
|
||||
+DEVEL_DIRECTORY := \
|
||||
+ $(shell findpaths -r "makefile_engine" B_FIND_PATH_DEVELOP_DIRECTORY)
|
||||
+include $(DEVEL_DIRECTORY)/etc/makefile-engine
|
||||
diff --git a/WMSlider.cpp b/WMSlider.cpp
|
||||
index 517a2e3..a2a045b 100644
|
||||
--- a/WMSlider.cpp
|
||||
+++ b/WMSlider.cpp
|
||||
@@ -32,15 +32,16 @@ class _WMCntrlSldr : public BSlider
|
||||
{
|
||||
friend class LSLider;
|
||||
public:
|
||||
- _WMCntrlSldr(BRect frame, char *title,
|
||||
- BStringView *sv,
|
||||
- long min, long max, long * valoc,
|
||||
- WMSlider * owner);
|
||||
- _WMCntrlSldr(BRect frame, char *title,
|
||||
+ _WMCntrlSldr(BRect frame, char *title,
|
||||
BStringView *sv,
|
||||
float scaling, float offset,
|
||||
int32 places, float * valoc,
|
||||
WMSlider * owner);
|
||||
+ _WMCntrlSldr(BRect frame, char *title,
|
||||
+ BStringView *sv,
|
||||
+ long int min, long int max, long int* valoc,
|
||||
+ WMSlider * owner);
|
||||
+
|
||||
void SetValue(int32 v);
|
||||
void SetFValue(float v);
|
||||
float FValue() {return fvalp? *fvalp : NAN;}
|
||||
@@ -57,7 +58,7 @@ class _WMCntrlSldr : public BSlider
|
||||
|
||||
// Note -- 'title' is currently always NULL (Border label used)
|
||||
_WMCntrlSldr::_WMCntrlSldr(BRect frame, char *title,
|
||||
- BStringView *sv, long min, long max, long * valoc,
|
||||
+ BStringView *sv, long int min, long int max, long int *valoc,
|
||||
WMSlider *owner) :
|
||||
BSlider(frame, "slider", title,
|
||||
new BMessage('smup'), min, max, B_BLOCK_THUMB,
|
||||
@@ -74,7 +75,7 @@ _WMCntrlSldr::_WMCntrlSldr(BRect frame, char *title,
|
||||
BStringView *sv,
|
||||
float scaling, float offset,
|
||||
int32 places, float * valoc,
|
||||
- WMSlider * owner) :
|
||||
+ WMSlider *owner) :
|
||||
BSlider(frame, "slider", title,
|
||||
new BMessage('smup'), 0, 1000, B_BLOCK_THUMB,
|
||||
B_FOLLOW_ALL_SIDES),
|
||||
@@ -165,7 +166,7 @@ WMSlider::WMSlider(BRect view_frame, int32 min, int32 max,
|
||||
BRect sr(SLIDER_X_PAD, txtspace,
|
||||
view_bound.Width()-SLIDER_X_PAD - t->Bounds().Width(),
|
||||
txtspace+10);
|
||||
- s = new _WMCntrlSldr(sr, NULL, t, min, max, valoc, this);
|
||||
+ s = new _WMCntrlSldr(sr, NULL, t, (long int)min, (long int)max, (long int*)valoc, this);
|
||||
s->ResizeTo(s->Bounds().Width(), s->ThumbFrame().Height()+2*SLIDER_Y_PAD);
|
||||
b->AddChild(s);
|
||||
t->MoveTo(s->Frame().RightTop());
|
||||
diff --git a/demo.sh b/demo.sh
|
||||
new file mode 100644
|
||||
index 0000000..52d6405
|
||||
--- /dev/null
|
||||
+++ b/demo.sh
|
||||
@@ -0,0 +1,46 @@
|
||||
+#! /bin/sh
|
||||
+
|
||||
+# A short script to illustrate the use of the "gadgeteer"
|
||||
+# command-line app.
|
||||
+
|
||||
+# A function is needed to let the shell read the output:
|
||||
+useOutput() {
|
||||
+ while true; do
|
||||
+ read TITLE
|
||||
+ if [ $? != 0 ]; then
|
||||
+ return; fi
|
||||
+ read FIRST
|
||||
+ read LAST
|
||||
+ read AGE
|
||||
+ read CHECK
|
||||
+ read BUTTON
|
||||
+ if [ "$BUTTON" ]; then echo "You pressed the button"; continue; fi
|
||||
+ echo "The name is $TITLE $FIRST $LAST"
|
||||
+ echo "Age is $AGE"
|
||||
+ if [ "$CHECK" ]; then echo "and Married"; fi
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
+# Using shell variables can be convenient:
|
||||
+ INIT="Billy"
|
||||
+
|
||||
+# The demonstration command line:
|
||||
+gadgeteer {title: DEMO, label: this is a demonstration, \
|
||||
+ label: of some gadgeteer features, \
|
||||
+ menu: [Mr, Mrs, Miss, Ms., Master, Sir, Lady, President, Their Majesty], \
|
||||
+ width: 300, div: 80, pos: right, textcontrol: {label: First Name, init: $INIT}, \
|
||||
+ pos: below, textcontrol: LastName, \
|
||||
+ slider: {label: Age, min: 1, max: 110, init: 21}, \
|
||||
+ checkbox: {label: Married, init: off}, \
|
||||
+ button: {label: PUSH ME, width: 50}} | useOutput
|
||||
+
|
||||
+# The command arguments are a YAML-syntax string and thus must be enclosed
|
||||
+# in braces. Each 'Directive' entry is a "key: value" pair, separated
|
||||
+# by commas. The space after a colon or comma is mandatory.
|
||||
+
|
||||
+# By default, items are stacked vertically. The "pos: right" resets this
|
||||
+# to put following items to the right of the first, the "pos: below" resets
|
||||
+# again. Note that the last item is vertically aligned with the previous.
|
||||
+# The menu has a list of items as its value; most of the other controls have
|
||||
+# extended parameter sets as their values. The "div" global parameter
|
||||
+# (currently) only applies to the textcontrol divider position.
|
||||
--
|
||||
2.19.0
|
||||
|
||||
Reference in New Issue
Block a user