-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
43 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,11 @@ jobs: | |
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macOS-latest | ||
##- macOS-latest | ||
- windows-latest | ||
raku-version: | ||
- 'latest' | ||
- '2020.05.1' | ||
##- '2021.08' | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -31,11 +31,18 @@ jobs: | |
choco install make | ||
choco install mingw | ||
refreshenv | ||
make -f Makefile.mingw dll # build distribution dll | ||
- name: Install Dependencies | ||
run: | | ||
zef install --/test App::Prove6 | ||
zef install --/test LibraryMake | ||
zef install --deps-only . | ||
zef build . | ||
- name: Run Tests | ||
run: prove6 -I. t | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Automated Windows DLL save | ||
commit_user_name: David Warring | ||
commit_user_email: [email protected] | ||
file_pattern: resources/libraries/base64.dll | ||
add_options: -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,6 @@ | |
*.gcov | ||
*.gcda | ||
*.gcno | ||
*.obj | ||
Makefile | ||
blib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,28 @@ | ||
#! /usr/bin/env perl6 | ||
#Note `zef build .` will run this script | ||
use v6; | ||
|
||
class Build { | ||
need LibraryMake; | ||
# adapted from deprecated Native::Resources | ||
|
||
#| Sets up a C<Makefile> and runs C<make>. C<$folder> should be | ||
#| C<"$folder/resources/libraries"> and C<$libname> should be the name of the library | ||
#| without any prefixes or extensions. | ||
sub make(Str $folder, Str $destfolder, IO() :$libname!) { | ||
my %vars = LibraryMake::get-vars($destfolder); | ||
%vars<LIB_BASE> = $libname; | ||
%vars<LIB_NAME> = ~ $*VM.platform-library-name($libname); | ||
mkdir($destfolder); | ||
LibraryMake::process-makefile($folder, %vars); | ||
my $proc = shell(%vars<MAKE>); | ||
if $proc.exitcode && Rakudo::Internals.IS-WIN { | ||
#issue #1 | ||
%vars<MAKE> = 'make'; | ||
%vars<CC> = 'gcc'; | ||
%vars<CCFLAGS> = '-fPIC -O3 -DNDEBUG --std=gnu99 -Wextra -Wall'; | ||
%vars<LD> = 'gcc'; | ||
%vars<LDSHARED> = '-shared'; | ||
%vars<LDFLAGS> = '-fPIC -O3'; | ||
%vars<CCOUT> = '-o '; | ||
%vars<LDOUT> = '-o '; | ||
for <make gmake> -> $maker { | ||
note "retrying build with gcc/{$maker}..."; | ||
%vars<MAKE> = $maker; | ||
LibraryMake::process-makefile($folder, %vars); | ||
$proc = shell(%vars<MAKE>); | ||
last unless $proc.exitcode; | ||
} | ||
} | ||
} | ||
use Native::Compile; | ||
|
||
method build($workdir) { | ||
method build($dir, Bool :$make = ! $*DISTRO.is-win) { | ||
my $destdir = 'resources/libraries'; | ||
mkdir 'resources'; | ||
mkdir $destdir; | ||
make($workdir, $destdir, :libname<base64>); | ||
my $libname = 'base64'; | ||
my $path = ($destdir ~ '/' ~ $libname).IO; | ||
my $target = $*VM.platform-library-name($path); | ||
if !$make && $target.IO.e { | ||
# to allow distribution of precompiled binaries | ||
note "using prebuilt library: $target"; | ||
} | ||
else { | ||
build :$dir, :lib<base64>, :src<src/base64.c>; | ||
} | ||
True; | ||
} | ||
} | ||
|
||
# Build.pm can also be run standalone | ||
sub MAIN(Str $working-directory = '.' ) { | ||
Build.new.build($working-directory); | ||
sub MAIN(Str $working-directory = '.', Bool :$make = ! $*DISTRO.is-win ) { | ||
Build.new.build($working-directory, :$make); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# used on github actions to build a DLL for distribution | ||
DIR=src | ||
SRC=$(DIR)/base64 | ||
TGT=resources/libraries/base64.dll | ||
|
||
dll : $(TGT) | ||
|
||
$(TGT) : $(SRC).obj | ||
gcc -shared -fPIC -O3 -DNDEBUG -Wl,-rpath,"//home/david/git/rakudo/install/lib" -o $(TGT) $(SRC).obj | ||
|
||
$(SRC).obj : $(SRC).c $(SRC).h | ||
gcc -I $(DIR) -c -fPIC -std=gnu99 -Wextra -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Werror=pointer-arith -Werror=vla -O3 -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -fPIC -DWSL_BASH_ON_WIN -DMVM_HEAPSNAPSHOT_FORMAT=2 -D_GNU_SOURCE -o $(SRC).obj $(SRC).c | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters