|
1 | 1 | import { BuildOptions, unarchive, run, inreplace } from "brewkit"; |
| 2 | +import env_include from "../../brewkit/env-include.ts"; |
2 | 3 |
|
3 | 4 | export default async function ({ prefix, tag, version }: BuildOptions) { |
4 | 5 | await unarchive(`https://github.com/ImageMagick/ImageMagick/archive/${tag}.tar.gz`); |
5 | 6 |
|
6 | 7 | // we use the DESTDIR trick or the install fails due to trying to write to /etc |
7 | 8 | // (despite the fact `--enable-zero-configuration` embeds them in the binaries) |
8 | | - Deno.env.set("DESTDIR", prefix.parent().parent().string); |
9 | | - |
10 | | - let extra = ''; |
11 | | - if (Deno.build.os == "darwin") { |
12 | | - // stolen from the Honebrew formula |
13 | | - extra = ` |
14 | | - "ac_cv_prog_c_openmp=-Xpreprocessor -fopenmp" |
15 | | - "ac_cv_prog_cxx_openmp=-Xpreprocessor -fopenmp" |
16 | | - LDFLAGS=-lomp |
17 | | - `; |
18 | | - } |
| 9 | + Deno.env.set("DESTDIR", prefix.string); |
19 | 10 |
|
20 | 11 | run`./configure |
21 | | - --prefix=/imagemagick.org/v${version} |
| 12 | + --prefix=/usr/local |
22 | 13 | --disable-debug |
23 | 14 | --sysconfdir=/etc |
24 | 15 | --enable-osx-universal-binary=no |
@@ -51,6 +42,11 @@ export default async function ({ prefix, tag, version }: BuildOptions) { |
51 | 42 |
|
52 | 43 | run`make --jobs ${navigator.hardwareConcurrency} install`; |
53 | 44 |
|
| 45 | + for await (const [path] of prefix.join("usr/local").ls()) { |
| 46 | + path.mv({ into: prefix }); |
| 47 | + } |
| 48 | + prefix.join("usr/local").rm().parent().rm(); |
| 49 | + |
54 | 50 | for (const x of ["Magick++", "MagickCore", "MagickWand"]) { |
55 | 51 | const fn = prefix.bin.join(`${x}-config`); |
56 | 52 | inreplace( |
|
0 commit comments