Commit | Line | Data |
---|---|---|
d5a9f2a4 PM |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com> | |
3 | ;;; | |
4 | ;;; This file is part of GNU Guix. | |
5 | ;;; | |
6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
7 | ;;; under the terms of the GNU General Public License as published by | |
8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
9 | ;;; your option) any later version. | |
10 | ;;; | |
11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | ;;; GNU General Public License for more details. | |
15 | ;;; | |
16 | ;;; You should have received a copy of the GNU General Public License | |
17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
18 | ||
19 | (define-module (gnu packages darwin) | |
20 | #:use-module (gnu packages) | |
21 | #:use-module (gnu packages autotools) | |
22 | #:use-module (gnu packages gnustep) | |
23 | #:use-module (gnu packages llvm) | |
24 | #:use-module (guix build-system gnu) | |
25 | #:use-module (guix gexp) | |
26 | #:use-module (guix git-download) | |
27 | #:use-module (guix packages) | |
28 | #:use-module (guix utils) | |
29 | #:use-module ((guix licenses) #:prefix license:)) | |
30 | ||
31 | (define-public cctools | |
32 | (let ((cctools-version "973.0.1") | |
33 | (ld64-version "609") | |
34 | (revision "0") | |
35 | (commit "04663295d0425abfac90a42440a7ec02d7155fea")) | |
36 | (package | |
37 | (name "cctools") | |
38 | (version (git-version (string-append cctools-version | |
39 | "-ld64-" | |
40 | ld64-version) | |
41 | revision | |
42 | commit)) | |
43 | (source | |
44 | (origin | |
45 | (method git-fetch) | |
46 | (uri (git-reference | |
47 | (url "https://github.com/tpoechtrager/cctools-port") | |
48 | (commit commit))) | |
49 | (sha256 | |
50 | (base32 "0vihfa8y64vvd3pxy8qh4mhcnzinxh9flpz9dvw4wch4zj2nnfjs")) | |
51 | (file-name (git-file-name name version)) | |
52 | (snippet | |
53 | #~(begin | |
54 | (use-modules (guix build utils)) | |
55 | (with-directory-excursion "cctools" | |
56 | ;; use system libobjc2 | |
57 | (substitute* "configure.ac" | |
58 | (("AC_CONFIG_FILES[(]\\[libobjc2/Makefile][)]") | |
59 | "")) | |
60 | (substitute* "Makefile.am" | |
61 | (("SUBDIRS=libobjc2 ") | |
62 | "SUBDIRS=")) | |
63 | (substitute* "otool/Makefile.am" | |
64 | (("\\$[(]top_builddir[)]/libobjc2/libobjc\\.la") | |
65 | "-lobjc") | |
66 | (("-I\\$[(]top_srcdir[)]/libobjc2") | |
67 | "")) | |
68 | ;; delete files | |
69 | (for-each (lambda (pth) | |
70 | (when (file-exists? pth) | |
71 | (delete-file-recursively pth))) | |
72 | `("include/gnu/symseg.h" ;; obsolete | |
73 | "libobjc2" ;; unbundle | |
74 | ;; generated files: | |
75 | "compile" | |
76 | "config.guess" | |
77 | "config.sub" | |
78 | "configure" | |
79 | "install-sh" | |
80 | "ltmain.sh" | |
81 | "missing" | |
82 | ,@(find-files "." "^Makefile\\.in$")))))))) | |
83 | (inputs (list libobjc2 | |
84 | clang-toolchain)) | |
85 | (native-inputs (list libtool | |
86 | autoconf | |
87 | automake | |
88 | clang-toolchain)) | |
89 | (build-system gnu-build-system) | |
90 | (arguments | |
91 | (list | |
92 | #:phases | |
93 | #~(modify-phases %standard-phases | |
94 | (add-after 'unpack 'chdir | |
95 | (lambda args | |
96 | (chdir "cctools")))))) | |
97 | (home-page "https://github.com/tpoechtrager/cctools-port") | |
98 | (synopsis "Darwin's @code{cctools} and @code{ld64}") | |
99 | ;; Confusingly enough, the program is called ld64, but the command is | |
100 | ;; just ld (with no symlink), so @command{ld64} would be wrong. | |
101 | (description | |
102 | "Darwin's @code{cctools} are a set of tools somewhat similar in purpose | |
103 | to GNU Binutils, but for Mach-O files targeting Darwin. The suite includes | |
104 | @command{install_name_tool}, @command{dyldinfo}, and other specialized tools | |
105 | in addition to standard utilities like @command{ld} and @command{as}. This | |
106 | package provides portable versions of the tools.") | |
107 | (license license:apsl2)))) |