From 1cb64e3aeb1e8ae9ba30b2b95d98e7cc94c0c8e8 Mon Sep 17 00:00:00 2001 From: clfreville2 Date: Sat, 6 May 2023 15:44:27 +0200 Subject: [PATCH] Initial commit --- .gitignore | 5 ++ debian/changelog | 26 +++++++ debian/control | 12 ++++ debian/copyright | 30 +++++++++ debian/patches/add-install-target.patch | 90 +++++++++++++++++++++++++ debian/patches/fix-macro-conflict.patch | 48 +++++++++++++ debian/patches/series | 2 + debian/rules | 7 ++ debian/source/format | 1 + 9 files changed, 221 insertions(+) create mode 100644 .gitignore create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/patches/add-install-target.patch create mode 100644 debian/patches/fix-macro-conflict.patch create mode 100644 debian/patches/series create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e6314a1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.debhelper + +examples +lib +src diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..85b9d03 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,26 @@ +asix (0.1.4-1) jammy; urgency=medium + + * Merge with source + * Remove bash completion + + -- Clément Fréville Sat, 06 May 2023 15:31:25 +0200 + +asix (1.1.3) jammy; urgency=low + + * Merge with source + + -- Clément Fréville Wed, 18 May 2022 17:16:51 +0200 + +asix (1.1.2) jammy; urgency=medium + + * Merge with source + + -- Clément Fréville Tue, 17 May 2022 07:22:35 +0200 + +asix (1.1.1) jammy; urgency=medium + + * Merge with source + * Add bash completion + * Change installation folders + + -- Clément Fréville Sat, 14 May 2022 11:20:17 +0200 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..54ca61a --- /dev/null +++ b/debian/control @@ -0,0 +1,12 @@ +Source: asix +Section: electronics +Priority: optional +Maintainer: Clément Fréville +Build-Depends: debhelper-compat (= 11), libsdl2-dev +Standards-Version: 4.6.0 +Rules-Requires-Root: no + +Package: asix +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, g++, inotify-tools, exuberant-ctags, x11-utils, libsdl2-dev, libsdl2-2.0-0 +Description: An Arduino simulator for POSIX diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..164dfca --- /dev/null +++ b/debian/copyright @@ -0,0 +1,30 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: asix +Upstream-Contact: Guénal Davalan +Source: + +Files: * +Copyright: 2023 +License: GPL-3.0+ + +Files: debian/* +Copyright: 2023 Clément Fréville +License: GPL-3.0+ + +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + diff --git a/debian/patches/add-install-target.patch b/debian/patches/add-install-target.patch new file mode 100644 index 0000000..be9553f --- /dev/null +++ b/debian/patches/add-install-target.patch @@ -0,0 +1,90 @@ +--- a/Makefile ++++ b/Makefile +@@ -18,3 +18,24 @@ + tgz: + make clean + ( cd .. && tar --exclude=rgeany -cvzf asix.tgz asix ) ++ ++prefix := /usr/local ++exec_prefix := $(prefix) ++bindir := $(exec_prefix)/bin ++libdir := $(exec_prefix)/lib ++includedir := $(prefix)/include ++datarootdir := $(prefix)/share ++INSTALL_BIN_DIR := $(DESTDIR)/$(bindir) ++INSTALL_LIB_DIR := $(DESTDIR)/$(libdir)/asix ++INSTALL_INCLUDE_DIR := $(DESTDIR)/$(includedir)/asix ++INSTALL_SHARE_DIR := $(DESTDIR)/$(datarootdir)/asix ++ ++install: all ++ install -d $(INSTALL_BIN_DIR) ++ install -m 755 asix $(INSTALL_BIN_DIR) ++ install -d $(INSTALL_LIB_DIR) ++ cp -r lib/. $(INSTALL_LIB_DIR) ++ install -d $(INSTALL_INCLUDE_DIR) ++ cp -r src/. $(INSTALL_INCLUDE_DIR) ++ install -d $(INSTALL_SHARE_DIR) ++ cp -r examples $(INSTALL_SHARE_DIR) +--- a/asix ++++ b/asix +@@ -20,7 +20,8 @@ + + PROG_NAME=$(readlink -f $0) + #INSTALL_DIR=$(readlink -f $(dirname $(dirname $PROG_NAME))) +-INSTALL_DIR=$(readlink -f $(dirname $PROG_NAME)) ++INSTALL_DIR="/usr/include/asix" ++LIB_DIR="/usr/lib/asix" + + [ -d /home/IUT/gudavala/bin ] && PATH="$PATH:/home/IUT/gudavala/bin" + +@@ -134,8 +135,8 @@ + while [ $# -gt 1 ]; do + case "$1" in + -b|-board|--board) [ $2 = "list" ] && { +- cd $INSTALL_DIR/src/boards; ls -1; exit 0; } +- [ ! -d $INSTALL_DIR/src/boards/$2 ] && \ ++ cd $INSTALL_DIR/boards; ls -1; exit 0; } ++ [ ! -d $INSTALL_DIR/boards/$2 ] && \ + error "Board $2 not defined !" + BOARD=$2 + shift +@@ -159,7 +160,7 @@ + shift + done + +- set -a; . $INSTALL_DIR/src/boards/$BOARD/$BOARD.sh; set +a ++ set -a; . $INSTALL_DIR/boards/$BOARD/$BOARD.sh; set +a + + case "$1" in + -h|-help|--help) help; exit 0;; +@@ -249,9 +250,9 @@ + ORIENTATION=$o + fi + +- INCLUDE_DIRS="-I$INSTALL_DIR/src -I$INSTALL_DIR/src/tone -I$INSTALL_DIR/src/rtc \ +- -I$INSTALL_DIR/src/x11 -I$INSTALL_DIR/src/boards/$BOARD -I$INSTALL_DIR/src/tft \ +- -I$INSTALL_DIR/src/Adafruit_ZeroTimer -I$INSTALL_DIR/src/LIS3DHTR ++ INCLUDE_DIRS="-I$INSTALL_DIR -I$INSTALL_DIR/tone -I$INSTALL_DIR/rtc \ ++ -I$INSTALL_DIR/x11 -I$INSTALL_DIR/boards/$BOARD -I$INSTALL_DIR/tft \ ++ -I$INSTALL_DIR/Adafruit_ZeroTimer -I$INSTALL_DIR/LIS3DHTR + " + #-I$INSTALL_DIR/src/lvgl -I$INSTALL_DIR/src/lvgl/src \ + +@@ -285,7 +286,7 @@ + #ls -l $TMP_OBJ + #nm $TMP_OBJ + +- cmd="$CC -o $TMP_EXE $TMP_OBJ -flto -Wl,-rpath,$INSTALL_DIR/lib -L$INSTALL_DIR/lib $LIBS" ++ cmd="$CC -o $TMP_EXE $TMP_OBJ -flto -Wl,-rpath,$LIB_DIR -L$LIB_DIR $LIBS" + echo $cmd + $cmd + r=$? +@@ -304,7 +305,7 @@ + #echo + #echo "done" + +- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL_DIR/lib" ++ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_DIR" + } + + return $r diff --git a/debian/patches/fix-macro-conflict.patch b/debian/patches/fix-macro-conflict.patch new file mode 100644 index 0000000..22271de --- /dev/null +++ b/debian/patches/fix-macro-conflict.patch @@ -0,0 +1,48 @@ +--- a/src/Arduino.h ++++ b/src/Arduino.h +@@ -208,8 +208,8 @@ + //#endif /* __cplusplus */ + + +-#define min(a,b) ((a)<(b)?(a):(b)) +-#define max(a,b) ((a)>(b)?(a):(b)) ++#define _min(a,b) ((a)<(b)?(a):(b)) ++#define _max(a,b) ((a)>(b)?(a):(b)) + + + #include "pins_arduino.h" +--- a/src/rtc/DateTime.cpp ++++ b/src/rtc/DateTime.cpp +@@ -319,7 +319,7 @@ + /**************************************************************************/ + DateTime::DateTime(const char *iso8601dateTime) { + char ref[] = "2000-01-01T00:00:00"; +- memcpy(ref, iso8601dateTime, min(strlen(ref), strlen(iso8601dateTime))); ++ memcpy(ref, iso8601dateTime, _min(strlen(ref), strlen(iso8601dateTime))); + yOff = conv2d(ref + 2); + m = conv2d(ref + 5); + d = conv2d(ref + 8); +--- a/src/tft/TFT_eSPI.h ++++ b/src/tft/TFT_eSPI.h +@@ -17,7 +17,7 @@ + #define _TFT_eSPIH_ + + #include "Arduino.h" +-#undef min ++#undef _min + + #include + //#include +@@ -316,9 +316,9 @@ + b = t; + } + +-#ifndef min +-// Return minimum of two numbers, may already be defined +-#define min(a, b) (((a) < (b)) ? (a) : (b)) ++#ifndef _min ++// Return _minimum of two numbers, may already be defined ++#define _min(a, b) (((a) < (b)) ? (a) : (b)) + #endif + + // This structure allows sketches to retrieve the user setup parameters at runtime diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..b1ff27f --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +add-install-target.patch +fix-macro-conflict.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..a48dcbb --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_install: + dh_auto_install -- prefix=/usr diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)