-
Notifications
You must be signed in to change notification settings - Fork 3
Write package scripts for a number of OSs/package managers #15
Comments
I can help with writing the PKGBUILD and Homebrew formula if you need it. |
I'm already hacking together a PKGBUILD, but it would be great if you could put together a Homebrew formula (I'd have to dust off my iMac to write that). |
Sure, I can write the homebrew formula. The only problem is that it'd depend on the Elixir version which is:
As far as I'm aware we still need 0.9.0 with Flect? |
PKGBUILD committed in 4341449. |
@novabyte regarding your IRC question: Just use whatever seems to be the convention for the package manager. So if |
Added MacPorts to the list. @novabyte: Can you also take a look at that in addition to Homebrew? |
Sure, I can I've not forgotten about the Homebrew I wasn't sure anyone really used MacPorts still, but I'll have a look at creating a Portfile. |
hey @alexrp Here's a Work-In-Progress for the Homebrew formula. There's a couple of remaining TODOs. require 'formula'
class Flect < Formula
homepage 'https://github.com/lycus/flect'
head 'https://github.com/lycus/flect.git', :revision => 'HEAD'
depends_on 'git' => :build
depends_on 'elixir' => :build
depends_on 'erlang'
def install
pwd = Pathname.new('.')
# TODO: detect arch and adjust
abi = ''
fpabi = ''
ohai 'Configuring the build...'
(pwd+'config.mak').write <<-EOF.undent
export FLECT_ARCH ?= x86
export FLECT_OS ?= linux
export FLECT_ABI ?= #{abi}
export FLECT_FPABI ?= #{fpabi}
export FLECT_CROSS ?= false
export FLECT_CC ?= clang
export FLECT_CC_TYPE ?= gcc
export FLECT_CC_ARGS ?=
export FLECT_LD ?= ld
export FLECT_LD_TYPE ?= ld
export FLECT_LD_ARGS ?=
export FLECT_PREFIX ?= #{prefix}/usr
export FLECT_BIN_DIR ?= #{prefix}/usr/bin
export FLECT_LIB_DIR ?= #{prefix}/usr/lib/flect
export FLECT_ST_LIB_DIR ?= #{prefix}/usr/lib/flect/static
export FLECT_SH_LIB_DIR ?= #{prefix}/usr/lib/flect/shared
EOF
ohai 'Building and installing...'
system 'make install'
# TODO: link the keg
end
test do
ohai 'Running test suite...'
system 'make test -j 1'
end
end |
I think it's safe to just say:
People rarely want to build 32-bit stuff on Mac anymore. |
I believe this will work. I cannot test it right now because the Elixir guys have just updated their Homebrew formula for their require 'formula'
class Flect < Formula
homepage 'https://github.com/lycus/flect'
head 'https://github.com/lycus/flect.git', :revision => 'HEAD'
depends_on 'elixir' => :build
depends_on 'erlang'
def install
pwd = Pathname.new('.')
abi = 'x86-sysv32'
fpabi = 'x86-x87'
if MacOS.prefer_64_bit?
abi = 'x86-sysv64'
fpabi = 'x86-sse'
end
ohai 'Configuring the build...'
(pwd+'config.mak').write <<-EOF.undent
export FLECT_ARCH ?= x86
export FLECT_OS ?= darwin
export FLECT_ABI ?= #{abi}
export FLECT_FPABI ?= #{fpabi}
export FLECT_CROSS ?= false
export FLECT_CC ?= clang
export FLECT_CC_TYPE ?= gcc
export FLECT_CC_ARGS ?=
export FLECT_LD ?= ld
export FLECT_LD_TYPE ?= ld
export FLECT_LD_ARGS ?=
export FLECT_PREFIX ?= #{prefix}/usr
export FLECT_BIN_DIR ?= #{prefix}/usr/bin
export FLECT_LIB_DIR ?= #{prefix}/usr/lib/flect
export FLECT_ST_LIB_DIR ?= #{prefix}/usr/lib/flect/static
export FLECT_SH_LIB_DIR ?= #{prefix}/usr/lib/flect/shared
EOF
ohai 'Building and installing...'
system "make", "install"
end
test do
ohai 'Running test suite...'
system "make", "test", "-j", "1"
end
end |
Note that if you're building Flect for 32-bit, you likely want to pass |
Also, did you intend to say |
You're right I'll make those changes in the morning, I've been staring at the script for too long and missing things now. I'll wait to test the formula then submit a pull request. I'll have a look into creating a |
Ok. It seems that it's necessary to do the following to install Elixir via Homebrew: $> brew uninstall erlang
$> brew tap homebrew/versions
$> brew install erlang-r16
$> brew update
$> brew install elixir The only problem with the above is that anyone wanting to casually install Shall I configure the Flect Homebrew Formula to depend on |
What are your thoughts about speaking with the Elixir team and seeing if they're open to bundling the required version of the Erlang VM with their build process? In the same way as the Basho team does with Riak. |
Homebrew formula committed in 4ce6932. |
|
Namely:
Feel free to reply with more package managers/OSs that I should add to the list if you're interested in putting effort into writing a script for that target.
The text was updated successfully, but these errors were encountered: