summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog5
-rw-r--r--debian/control30
-rw-r--r--debian/freebasic-examples.install1
-rw-r--r--debian/freebasic.docs1
-rw-r--r--debian/freebasic.install3
-rw-r--r--debian/patches/debian.patch24
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules49
-rw-r--r--debian/source/format1
9 files changed, 115 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..8bce398
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+freebasic (1.10.0~2022.10.30.git.d6c7b0d-0pin1) unstable; urgency=medium
+
+ * Build for me.
+
+ -- Igor Pashev <pashev.igor@gmail.com> Tue, 15 Nov 2022 14:51:39 +0200
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..2826051
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,30 @@
+Source: freebasic
+Section: devel
+Priority: optional
+Maintainer: Igor Pashev <pashev.igor@gmail.com>
+Build-Depends: debhelper-compat (= 13),
+ freebasic
+Standards-Version: 4.0.0
+Homepage: https://www.freebasic.net
+
+Package: freebasic
+Architecture: any
+Provides: fbc
+Depends: gcc, libffi-dev, libgl1-mesa-dev, libncurses-dev, libx11-dev, libxext-dev,
+ libxpm-dev, libxrandr-dev, libxrender-dev
+Description: Compiler for the FreeBASIC programming language
+ FreeBASIC is a high-level programming language supporting
+ procedural, object-orientated and meta-programming paradigms,
+ with a syntax compatible to Microsoft QuickBASIC.
+
+Package: freebasic-examples
+Architecture: all
+Depends: ${misc:Depends}
+Description: FreeBASIC examples
+ FreeBASIC is a high-level programming language supporting
+ procedural, object-orientated and meta-programming paradigms,
+ with a syntax compatible to Microsoft QuickBASIC.
+ .
+ This package includes source code of various programs written
+ in FreeBASIC.
+
diff --git a/debian/freebasic-examples.install b/debian/freebasic-examples.install
new file mode 100644
index 0000000..a6509da
--- /dev/null
+++ b/debian/freebasic-examples.install
@@ -0,0 +1 @@
+examples /usr/share/doc/freebasic
diff --git a/debian/freebasic.docs b/debian/freebasic.docs
new file mode 100644
index 0000000..b2b2a78
--- /dev/null
+++ b/debian/freebasic.docs
@@ -0,0 +1 @@
+readme.txt
diff --git a/debian/freebasic.install b/debian/freebasic.install
new file mode 100644
index 0000000..bc9abe6
--- /dev/null
+++ b/debian/freebasic.install
@@ -0,0 +1,3 @@
+usr/bin/fbc
+usr/include/freebasic
+usr/lib/*/freebasic
diff --git a/debian/patches/debian.patch b/debian/patches/debian.patch
new file mode 100644
index 0000000..bf13934
--- /dev/null
+++ b/debian/patches/debian.patch
@@ -0,0 +1,24 @@
+--- freebasic-1.10.0~2022.10.30.git.d6c7b0d.orig/makefile
++++ freebasic-1.10.0~2022.10.30.git.d6c7b0d/makefile
+@@ -157,6 +157,7 @@ CFLAGS := -Wfatal-errors -O2
+ # Avoid gcc exception handling bloat
+ CFLAGS += -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables
+ FBFLAGS := -maxerr 1
++FBCFLAGS := -i inc -d 'LIBDIR="$(libdir)"'
+ AS = $(BUILD_PREFIX)as
+ AR = $(BUILD_PREFIX)ar
+ CC = $(BUILD_PREFIX)gcc
+--- freebasic-1.10.0~2022.10.30.git.d6c7b0d.orig/src/compiler/fbc.bas
++++ freebasic-1.10.0~2022.10.30.git.d6c7b0d/src/compiler/fbc.bas
+@@ -2958,7 +2958,11 @@ private sub fbcSetupCompilerPaths( )
+ fbc.binpath = fbc.prefix + "bin" + FB_HOST_PATHDIV + fbc.targetprefix
+ end if
+ fbc.incpath = fbc.prefix + "include" + FB_HOST_PATHDIV + fbname
++#ifndef LIBDIR
+ fbc.libpath = fbc.prefix + libdirname + FB_HOST_PATHDIV + fbname + FB_HOST_PATHDIV + targetid
++#else
++ fbc.libpath = fbc.prefix + LIBDIR
++#endif
+ #endif
+ end sub
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..3893360
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+debian.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..e31ccb2
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,49 @@
+#!/usr/bin/make -f
+
+include /usr/share/dpkg/buildflags.mk
+include /usr/share/dpkg/architecture.mk
+
+LIBDIR := lib/$(DEB_HOST_MULTIARCH)/freebasic
+BUILD_FBC := fbc
+OPTIONS := prefix=/usr libdir=$(LIBDIR)
+
+%:
+ dh $@
+
+override_dh_auto_build:
+ make V=1 CFLAGS="$(CFLAGS)" $(OPTIONS) FBC='$(BUILD_FBC)'
+
+override_dh_auto_install:
+ make V=1 DESTDIR=$(CURDIR)/debian/tmp $(OPTIONS) install
+
+override_dh_auto_clean:
+ make $(OPTIONS) clean
+ make -C tests $(OPTIONS) clean
+
+override_dh_auto_test:
+ make -C tests $(OPTIONS) FBC="$(CURDIR)/bin/fbc -i $(CURDIR)/inc" unit-tests
+
+override_dh_compress:
+ dh_compress -X /examples/
+
+GIT_REPO := https://github.com/freebasic/fbc
+DEBIAN_PATH := $(abspath $(dir $(firstword $(MAKEFILE_LIST))))
+PACKAGE := $(shell dpkg-parsechangelog -l$(DEBIAN_PATH)/changelog | awk '/^Source:/ {print $$2}')
+SRC_VERSION := $(shell dpkg-parsechangelog -l$(DEBIAN_PATH)/changelog | awk '/^Version:/ {sub(/-[^-]*/, "", $$2); print $$2}')
+GIT_REVISION := $(shell echo $(SRC_VERSION) | sed -r 's,.+git\.(\w+).*,\1,')
+TARBALL := $(PACKAGE)_$(SRC_VERSION).orig.tar.xz
+DELETE := \
+ contrib \
+ doc/build-win32.bat
+.PHONY: get-orig-source
+get-orig-source:
+ rm -rf get-orig-source $(TARBALL) && mkdir get-orig-source
+ git clone $(GIT_REPO) get-orig-source/$(PACKAGE)-$(SRC_VERSION)
+ git -C get-orig-source/$(PACKAGE)-$(SRC_VERSION) checkout $(GIT_REVISION)
+ find get-orig-source/$(PACKAGE)-$(SRC_VERSION) -name '.*' -print0 | xargs -0 --no-run-if-empty rm -rfv
+ cd get-orig-source/$(PACKAGE)-$(SRC_VERSION) && \
+ rm -rfv $(DELETE) && \
+ echo "FBVERSION := $(SRC_VERSION)" > version.mk
+ tar cJf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION)
+ rm -rf get-orig-source
+ @echo " "$(TARBALL)" created; move it to the right destination to build the package"
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)