From 1e53a0be49656dcef96e31a59849ce69f7699f58 Mon Sep 17 00:00:00 2001 From: Parnikkapore <9170353+parnikkapore@users.noreply.github.com> Date: Wed, 5 Jul 2023 16:21:55 +0800 Subject: [PATCH] Add simplistic packaging infrastructure The other option would be to use Haikuporter, but it's kind of too heavy for simpler use cases. --- Makefile | 28 ++++++++++++++++++++++++++++ README.md | 2 ++ package/.PackageInfo | 22 ++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 package/.PackageInfo diff --git a/Makefile b/Makefile index 45376fd..8bde383 100644 --- a/Makefile +++ b/Makefile @@ -133,3 +133,31 @@ DRIVER_PATH = DEVEL_DIRECTORY := \ $(shell findpaths -r "makefile_engine" B_FIND_PATH_DEVELOP_DIRECTORY) include $(DEVEL_DIRECTORY)/etc/makefile-engine + +# Package creation ############################################################# + +PACKAGE_DIR := . + +TARGET_FILENAME := $(basename $(TARGET)) +$(PACKAGE_DIR)/$(NAME).hpkg: $(TARGET) package/.PackageInfo + # Set up the package structure + cp -r package _build_package + mkdir -p _build_package/apps + cp '$(TARGET)' _build_package/apps/'$(TARGET_FILENAME)' + mkdir -p _build_package/data/deskbar/menu/Applications/ + (cd _build_package/data/deskbar/menu/Applications/; \ + ln -s ../../../../apps/'$(TARGET_FILENAME)' .) + mkdir -p _build_package/data/mime_db/ + mimeset --all --mimedb _build_package/data/mime_db/ --mimedb /system/data/mime_db/ '$(TARGET)' + # Generate the package + mkdir -p '$(PACKAGE_DIR)' + package create -C _build_package '$(PACKAGE_DIR)'/'$(NAME)'.hpkg + # And clean up + rm -r _build_package +package: $(PACKAGE_DIR)/$(NAME).hpkg + +rmpackage: + -rm -rf _build_package + -rm -f '$(PACKAGE_DIR)'/'$(NAME)'.hpkg + +.PHONY: package rmpackage diff --git a/README.md b/README.md index fb382ce..4226ff4 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,5 @@ It's a large, Conky-inspired clock display intended to be a replicant! Although We use pretty much the standard makefile engine setup. Simply run `make` at the top directory and you should be good to go! This project does not have any dependencies beyond the C++ development environment. + +A .hpkg package may be created by running `make package`. diff --git a/package/.PackageInfo b/package/.PackageInfo new file mode 100644 index 0000000..20f1977 --- /dev/null +++ b/package/.PackageInfo @@ -0,0 +1,22 @@ +name BigClock +version 0.1.1-1 +architecture x86_64 + +summary "Nice and large clock replicant" +urls "https://github.com/parnikkapore/hk-HugeClock/" +description "A large, Conky-inspired clock display intended to be a replicant! Although of course you can run it as an app as well." + +packager "Parnikkapore" +vendor "Parnikkapore" + +copyrights "2019-2023 Parnikkapore" +licenses "MPL v2.0" + +provides { + BigClock = 0.1.1-1 + app:BigClock = 0.1.1 +} + +requires { + haiku >= r1~beta2 +}