Skip to content

Commit

Permalink
[AppVeyor] build chocolatey package
Browse files Browse the repository at this point in the history
  • Loading branch information
andyli committed Jan 23, 2017
1 parent 91aac01 commit 575becd
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ COMMIT_DATE=$(shell \
fi \
)
PACKAGE_FILE_NAME=haxe_$(COMMIT_DATE)_$(COMMIT_SHA)
HAXE_VERSION=$(shell $(OUTPUT) -version 2>&1 | awk '{print $$1;}')

# using $(CURDIR) on Windows will not work since it might be a Cygwin path
ifdef SYSTEMROOT
Expand Down
15 changes: 13 additions & 2 deletions Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,28 @@ CC_CMD=($(OCAMLOPT) $(ALL_CFLAGS) -c $< 2>tmp.cmi && $(FILTER)) || ($(FILTER) &&
CC_PARSER_CMD=($(OCAMLOPT) -pp camlp4o $(ALL_CFLAGS) -c src/syntax/parser.ml 2>tmp.cmi && $(FILTER)) || ($(FILTER) && exit 1)
endif

PACKAGE_FILES=$(OUTPUT) haxelib$(EXTENSION) std "$$(cygpath -w "$$(which zlib1.dll)")" "$$(cygpath -w "$$(which libpcre-1.dll)")"

package_win:
mkdir -p out
rm -rf $(PACKAGE_FILE_NAME) $(PACKAGE_FILE_NAME).zip temp.zip
# Copy the package contents to $(PACKAGE_FILE_NAME)
# Using poor man's cp (zip then unzip), because cp in cygwin is quite broken
mkdir -p $(PACKAGE_FILE_NAME)
7z a -y -tzip -mx0 temp.zip $(OUTPUT) haxelib$(EXTENSION) std "$$(cygpath -w "$$(which zlib1.dll)")" "$$(cygpath -w "$$(which libpcre-1.dll)")" > log.txt || type log.txt
7z a -y -tzip -mx0 temp.zip $(PACKAGE_FILES) > log.txt || type log.txt
cd extra && 7z a -y -tzip -mx0 ../temp.zip LICENSE.txt CONTRIB.txt CHANGES.txt > log.txt || type log.txt
7z x -y temp.zip -o$(PACKAGE_FILE_NAME) > log.txt || type log.txt
rm temp.zip
# archive
7z a -r -tzip out/$(PACKAGE_FILE_NAME)_bin.zip $(PACKAGE_FILE_NAME) > log.txt || type log.txt
rm -r $(PACKAGE_FILE_NAME)
rm log.txt extra/log.txt
rm log.txt extra/log.txt

package_choco:
mkdir -p OUTPUT
7z x -y out/$(PACKAGE_FILE_NAME)_bin.zip -oout > log.txt || type log.txt
mv out/$(PACKAGE_FILE_NAME) out/choco
sed -e 's/@SNAPSHOT_VERSION@/$(HAXE_VERSION)-SNAP$(COMMIT_SHA)/g' extra/choco/haxe.nuspec > out/choco/haxe.nuspec
cd out/choco && choco pack
mv out/choco/haxe.*.nupkg out
rm -rf out/choco
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ build_script:
- 'set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%'
- 'set HAXEPATH=%APPVEYOR_BUILD_FOLDER%'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && make -s -f Makefile.win package_bin"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && make -s -f Makefile.win package_choco"'
- dir %APPVEYOR_BUILD_FOLDER%\out
- cd %APPVEYOR_BUILD_FOLDER%/tests/
- mkdir "%HAXELIB_ROOT%"
Expand Down
27 changes: 27 additions & 0 deletions extra/choco/haxe.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>haxe</id>
<version>@SNAPSHOT_VERSION@</version>
<title>Haxe</title>
<authors>Haxe Foundation</authors>
<owners>Haxe Foundation</owners>
<licenseUrl>http://haxe.org/foundation/open-source.html</licenseUrl>
<projectUrl>http://haxe.org/</projectUrl>
<docsUrl>http://haxe.org/manual/introduction.html</docsUrl>
<mailingListUrl>https://groups.google.com/forum/#!forum/haxelang</mailingListUrl>
<bugTrackerUrl>https://github.com/HaxeFoundation/haxe/issues</bugTrackerUrl>
<projectSourceUrl>https://github.com/HaxeFoundation/haxe</projectSourceUrl>
<packageSourceUrl>https://github.com/HaxeFoundation/haxe/tree/master/extra/choco</packageSourceUrl>
<iconUrl>http://haxe.org/img/haxe-logo.svg</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>Haxe is an open source toolkit based on a modern, high level, strictly typed programming language, a cross-compiler, a complete cross-platform standard library and ways to access each platform's native capabilities.</summary>
<description>Haxe is an open source toolkit based on a modern, high level, strictly typed programming language, a cross-compiler, a complete cross-platform standard library and ways to access each platform's native capabilities.

This package will install haxe and haxelib. After installation, you should run `haxelib setup &lt;path&gt;`, where `&lt;path&gt;` is the haxelib repository folder for placing third-party libraries. The folder should be created manually before running the command.</description>
<tags>haxe</tags>
<dependencies>
<dependency id="neko" />
</dependencies>
</metadata>
</package>

0 comments on commit 575becd

Please sign in to comment.