Skip to content

Commit

Permalink
Add simplistic packaging infrastructure
Browse files Browse the repository at this point in the history
The other option would be to use Haikuporter, but it's kind of too
heavy for simpler use cases.
  • Loading branch information
parnikkapore committed Jul 5, 2023
1 parent 0d6857f commit 1e53a0b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
22 changes: 22 additions & 0 deletions package/.PackageInfo
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 1e53a0b

Please sign in to comment.