From e9e1eaea62c296ba3aa7a33eded6d3452317b971 Mon Sep 17 00:00:00 2001 From: mariuszkurek Date: Wed, 19 Oct 2022 23:19:44 +0200 Subject: [PATCH] Debian build system --- .gitignore | 9 +++++++++ debian/changelog | 5 +++++ debian/control | 28 ++++++++++++++++++++++++++++ debian/copyright | 38 ++++++++++++++++++++++++++++++++++++++ debian/postinst | 41 +++++++++++++++++++++++++++++++++++++++++ debian/rules | 42 ++++++++++++++++++++++++++++++++++++++++++ debian/source/format | 1 + debian/watch | 15 +++++++++++++++ 8 files changed, 179 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/postinst create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/watch diff --git a/.gitignore b/.gitignore index 267f3d766..b4c67ef0a 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,12 @@ RC* # Qt Creator CMakeLists.txt.user + +# Debian builder +/debian/*.log +/debian/*.substvars +/debian/.debhelper +/debian/86box +/debian/debhelper-build-stamp +/debian/files +/obj-*-linux-gnu diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000000000..8ccc46aab --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +86box (3.7.1-1) UNRELEASED; urgency=medium + + * Initial release. + + -- Mariusz Kurek Wed, 19 Oct 2022 21:06:00 +0200 diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..752118be4 --- /dev/null +++ b/debian/control @@ -0,0 +1,28 @@ +Source: 86box +Section: otherosfs +Priority: optional +Maintainer: Mariusz Kurek +Build-Depends: cmake (>= 3.21), + debhelper-compat (= 13), + libevdev-dev, + libfreetype-dev, + libopenal-dev, + librtmidi-dev, + libsdl2-dev, + libslirp-dev, + ninja-build, + qttools5-dev +Standards-Version: 4.6.0 +Homepage: https://86box.net/ +#Vcs-Browser: https://salsa.debian.org/debian/86box +#Vcs-Git: https://salsa.debian.org/debian/86box.git +Rules-Requires-Root: no + +Package: 86box +Architecture: amd64 armhf arm64 i386 +Depends: ${shlibs:Depends}, + ${misc:Depends}, + sse2-support [i386] +Recommends: libpcap0.8-dev +Description: An emulator for classic IBM PC clones +#TODO: insert long description, indented with spaces diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 000000000..22817edc5 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,38 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: 86box +Source: https://86box.net/ + +Files: * +Copyright: + +License: GPL-2.0+ + +Files: debian/* +Copyright: 2022 Mariusz Kurek +License: GPL-2.0+ + +License: GPL-2.0+ + This package 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 2 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 2 can be found in "/usr/share/common-licenses/GPL-2". + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. +# Please avoid picking licenses with terms that are more restrictive than the +# packaged work, as it may make Debian's contributions unacceptable upstream. +# +# If you need, there are some extra license texts available in two places: +# /usr/share/debhelper/dh_make/licenses/ +# /usr/share/common-licenses/ diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 000000000..b3080e419 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,41 @@ +#!/bin/sh +# postinst script for 86box +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + echo You need ROM files in order to use 86Box. These can be obtained from https://github.com/86Box/roms + echo You can put the roms folder in, for example, /usr/share/86Box/roms or \~/.local/share/86Box/roms + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..0f4ec85f3 --- /dev/null +++ b/debian/rules @@ -0,0 +1,42 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + +ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH) + +ifeq ($(ARCH), $(filter $(ARCH), amd64 i386)) + NDR=off + ifeq ($(ARCH),amd64) + TOOLCHAIN=cmake/flags-gcc-x86_64.cmake + elif + TOOLCHAIN=cmake/flags-gcc-i686.cmake + endif +else + NDR=on + ifeq ($(ARCH),armhf) + TOOLCHAIN=cmake/flags-gcc-armv7.cmake + else + TOOLCHAIN=cmake/flags-gcc-aarch64.cmake + endif +endif + +%: + dh $@ --buildsystem cmake+ninja + +override_dh_auto_configure: + dh_auto_configure --buildsystem cmake+ninja -- --preset regular --toolchain $(TOOLCHAIN) -DNEW_DYNAREC=$(NDR) -DSLIRP_EXTERNAL=on + +override_dh_auto_test: + +override_dh_auto_install: + dh_auto_install --buildsystem cmake+ninja + for i in 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512 ; do \ + install -Dm644 src/unix/assets/$$i/net.86box.86Box.png -t debian/86box/usr/share/icons/hicolor/$$i/apps ; \ + done + mkdir debian/86box/usr/share/applications + sed 's/^Exec.*/Exec=86Box -P .local\/share\/86Box/' "src/unix/assets/net.86box.86Box.desktop" > "debian/86box/usr/share/applications/net.86box.86Box.desktop" + +override_dh_installdocs: + +override_dh_installman: diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 000000000..6f790c753 --- /dev/null +++ b/debian/watch @@ -0,0 +1,15 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# See uscan(1) for format + +# Compulsory line, this is a version 4 file +version=4 + +# PGP signature mangle, so foo.tar.gz has foo.tar.gz.sig +#opts="pgpsigurlmangle=s%$%.sig%" + +# GitHub hosted projects +opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%-$1.tar.gz%" \ + https://github.com/86Box/86Box/tags \ + (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate