aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPolyester <polyester@egregore.fun>2024-10-02 22:38:38 +0200
committerPolyester <polyester@egregore.fun>2024-10-02 22:38:38 +0200
commitdffa6e54ea424eb6037fa33f7565e6373ff37650 (patch)
treebbd82e04231f17512da1cd9376587319b8bf31d6
parent1c4ccb4a08d21ac3f504359dd686b573be03feeb (diff)
guix.scm packaging
-rw-r--r--Makefile7
-rw-r--r--guix.scm35
2 files changed, 41 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index bb08f4c..5d32d20 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,11 @@
CC=gcc
CFLAGS ?= -Wall -g -I./include
+PREFIX=/usr/local
+BINDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/share/man
+
+
mcping: mcping.c mctypes.o mcnetwork.o
$(CC) $(CFLAGS) $^ -o $@
@@ -17,4 +22,4 @@ clean:
rm -f *.o *~
install: mcping
- cp $^ $(PREFIX)/bin
+ install -D -m 0755 -t $(DESTDIR)$(BINDIR) $^
diff --git a/guix.scm b/guix.scm
new file mode 100644
index 0000000..65036fb
--- /dev/null
+++ b/guix.scm
@@ -0,0 +1,35 @@
+(use-modules
+ (guix gexp)
+ (guix git-download)
+ (guix utils)
+ (guix packages)
+ ((guix licenses) #:prefix license:)
+ (guix build-system gnu))
+
+(define vcs-file?
+ (or (git-predicate (current-source-directory))
+ (const #t)))
+
+(define-public mcping
+ (package
+ (name "mcping")
+ (version "1.0")
+ (source (local-file "." "mcping-checkout"
+ #:recursive? #t
+ #:select? vcs-file?))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:tests? #f ;; Tests require network.
+ #:make-flags
+ #~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "PREFIX=" #$output))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure))))
+ (home-page "https://www.gnu.org/software/hello/")
+ (synopsis "C implementation of the Server List Ping from Minecraft.")
+ (description "Returns the result of a Server List Ping on a Minecraft server.")
+ (license license:agpl3+)))
+
+;; This allows you to run guix shell -f guix-packager.scm.
+;; Remove this line if you just want to define a package.
+mcping