dev.fron.io rc / 81e8dbe
packages: bump papermc to r777 Tony Olagbaiye a month ago
1 changed file(s) with 57 addition(s) and 48 deletion(s). Raw diff Collapse all Expand all
99 #:use-module (gnu packages java)
1010 #:export (papermc))
1111
12 (define* (make-papermc
13 #:key (mc-version "1.16.5")
14 (build-num "777")
15 (src-hash (base32 "0pp6dxn53aw6iiy9wnbkkmg8mcqpx8wy6nify8j4hrzvzrmks82c")))
16 (package
17 (name "papermc")
18 (version (string-append mc-version "r" build-num))
19 (source (origin
20 (method url-fetch)
21 (uri (string-append "https://papermc.io/api/v1/paper/"
22 mc-version
23 "/"
24 build-num
25 "/download"))
26 (sha256 src-hash)))
27 (build-system trivial-build-system)
28 (inputs `(("openjdk" ,openjdk16)
29 ("bash" ,bash)))
30 (arguments
31 `(#:modules ((guix build utils))
32 #:builder (begin
33 (use-modules (guix build utils)
34 (srfi srfi-26))
35 (let* ((source (assoc-ref %build-inputs "source"))
36 (patchelf (assoc-ref %build-inputs "patchelf"))
37 (openjdk (assoc-ref %build-inputs "openjdk"))
38 (bash (assoc-ref %build-inputs "bash"))
39 (output (assoc-ref %outputs "out")))
40 (mkdir-p (string-append output "/share/papermc"))
41 (copy-file source (string-append output "/share/papermc/papermc.jar"))
42 (mkdir-p (string-append output "/bin"))
43 ;; TODO: replace this with lisp (use install-jars, etc)
44 (let ((port (open-file (string-append output "/bin/minecraft-server") "a")))
45 (display (string-append "#!" (string-append bash "/bin/sh") "\n") port)
46 (display (string-append "exec -a minecraft-server "
47 (string-append openjdk "/bin/java ")
48 "$@ "
49 "-jar "
50 (string-append output "/share/papermc/papermc.jar ")
51 "nogui "
52 "\n") port)
53 ;; TODO: use some syntax sugar like "with-output-to-port"?
54 (close port))
55 (chmod (string-append output "/bin/minecraft-server") #o555)
56 #t))))
57 (home-page "https://papermc.io")
58 (synopsis "High-performance Minecraft Server")
59 (description "High-performance Minecraft Server")
60 (license license:gpl3)))
61
62 (define papermc-r771
63 (make-papermc
64 #:mc-version "1.16.5"
65 #:build-num "771"
66 #:src-hash (base32 "1lmlfhigbzbkgzfq6knglka0ccf4i32ch25gkny0c5fllmsnm08l")))
67
1268 (define papermc
13 (let ((mc-version "1.16.5")
14 (build-num "771"))
15 (package
16 (name "papermc")
17 (version (string-append mc-version "r" build-num))
18 (source (origin
19 (method url-fetch)
20 (uri (string-append "https://papermc.io/api/v1/paper/"
21 mc-version
22 "/"
23 build-num
24 "/download"))
25 (sha256
26 (base32
27 "1lmlfhigbzbkgzfq6knglka0ccf4i32ch25gkny0c5fllmsnm08l"))))
28 (build-system trivial-build-system)
29 (inputs `(("openjdk" ,openjdk16)
30 ("bash" ,bash)))
31 (arguments
32 `(#:modules ((guix build utils))
33 #:builder (begin
34 (use-modules (guix build utils)
35 (srfi srfi-26))
36 (let* ((source (assoc-ref %build-inputs "source"))
37 (patchelf (assoc-ref %build-inputs "patchelf"))
38 (openjdk (assoc-ref %build-inputs "openjdk"))
39 (bash (assoc-ref %build-inputs "bash"))
40 (output (assoc-ref %outputs "out")))
41 (mkdir-p (string-append output "/share/papermc"))
42 (copy-file source (string-append output "/share/papermc/papermc.jar"))
43 (mkdir-p (string-append output "/bin"))
44 ;; TODO: replace this with lisp (use install-jars, etc)
45 (let ((port (open-file (string-append output "/bin/minecraft-server") "a")))
46 (display (string-append "#!" (string-append bash "/bin/sh") "\n") port)
47 (display (string-append "exec -a minecraft-server "
48 (string-append openjdk "/bin/java ")
49 "-jar "
50 (string-append output "/share/papermc/papermc.jar ")
51 "nogui "
52 "\n") port)
53 ;; TODO: use some syntax sugar like "with-output-to-port"?
54 (close port))
55 (chmod (string-append output "/bin/minecraft-server") #o555)
56 #t))))
57 (home-page "https://papermc.io")
58 (synopsis "High-performance Minecraft Server")
59 (description "High-performance Minecraft Server")
60 (license license:gpl3))))
69 (make-papermc))
6170
6271 papermc