Commit 138b5430 authored by Ed Reel's avatar Ed Reel Committed by GitHub

Merge pull request #1717 from Kozzi11/ldc

Add dlang support (ldc2,ldmd2,dub)
parents 66b6eebd ae8752e6
require 'package'
class Dub < Package
description 'Developer package manager for D programming language'
homepage 'https://github.com/D-Programming-Language/dub'
version '1.7.1'
source_url 'https://github.com/dlang/dub/archive/v1.7.1.tar.gz'
source_sha256 'baa8c533f59d83f74e89c06f5ec7e52daf3becb227c7177a9eeab7159ba86dbc'
binary_url ({
})
binary_sha256 ({
})
depends_on 'ldc'
def self.build
system "echo \"module dub.version_;\" > source/dub/version_.d"
system "echo 'enum dubVersion = \"1.7.1\";' >> source/dub/version_.d"
system "ldmd2 -ofbin/dub -w -O -g -version=DubUseCurl -Isource -L-lcurl @build-files.txt"
end
def self.install
system "install", "-Dm755", "bin/dub", "#{CREW_DEST_PREFIX}/bin/dub"
end
end
require 'package'
class Ldc < Package # The first character of the class name must be upper case
description 'D language compiler using LLVM.'
homepage 'https://github.com/ldc-developers/ldc'
version '1.7.0'
source_url 'https://github.com/ldc-developers/ldc/releases/download/v1.7.0/ldc-1.7.0-src.tar.gz'
source_sha256 '7cd46140ca3e4ca0d52c352e5b694d4d5336898ed4f02c3e18e0eafd69dd18bd'
binary_url ({
})
binary_sha256 ({
})
depends_on 'llvm'
depends_on 'curl'
depends_on 'gcc'
depends_on 'ncurses'
depends_on 'zlibpkg'
depends_on 'libconfig' => :build
depends_on 'cmake' => :build
depends_on 'libedit' => :build
def self.build # the steps required to build the package
system "mkdir", "build"
system "curl -L https://github.com/ldc-developers/ldc/releases/download/v0.17.5/{ldc-0.17.5-src.tar.gz} -o \"#1\""
abort 'Checksum mismatch. :/ Try again.'.lightred unless Digest::SHA256.hexdigest( File.read('ldc-0.17.5-src.tar.gz') ) == '7aa540a135f9fa1ee9722cad73100a8f3600a07f9a11d199d8be68887cc90008'
system "tar xzf ldc-0.17.5-src.tar.gz -C build"
system "cmake", "-Bbuild/ldc-0.17.5-src", "-Hbuild/ldc-0.17.5-src"
system "make", "-C", "build/ldc-0.17.5-src", "-j#{CREW_NPROC}"
system "cmake", "-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_SKIP_RPATH=ON", "-DBUILD_SHARED_LIBS=BOTH",
"-DLDC_WITH_LLD=OFF", "-DD_COMPILER=build/ldc-0.17.5-src/bin/ldmd2",
"-DCMAKE_INSTALL_PREFIX=#{CREW_PREFIX}", "-Bbuild", "-H."
system "make", "-C", "build", "-j#{CREW_NPROC}"
end
def self.install # the steps required to install the package
system "make", "-C", "build", "DESTDIR=#{CREW_DEST_DIR}", "install"
end
end
require 'package'
class Libconfig < Package
description 'C/C++ Configuration File Library.'
homepage 'https://hyperrealm.github.io/libconfig/'
version '1.7.2'
source_url 'https://hyperrealm.github.io/libconfig/dist/libconfig-1.7.2.tar.gz'
source_sha256 '7c3c7a9c73ff3302084386e96f903eb62ce06953bb1666235fac74363a16fad9'
binary_url ({
})
binary_sha256 ({
})
def self.build
system "./configure --prefix=#{CREW_PREFIX} --libdir=#{CREW_LIB_PREFIX}"
system "make"
end
def self.install
system "make", "DESTDIR=#{CREW_DEST_DIR}", "install"
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment