Skip to content

Commit

Permalink
Generate specs
Browse files Browse the repository at this point in the history
  • Loading branch information
borodust committed Oct 12, 2019
1 parent bca293d commit 4a64e63
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 46 deletions.
15 changes: 8 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,28 @@ branches:
install:
- set APPVEYOR_BUILD_DIR=$(cygpath -u '%APPVEYOR_BUILD_FOLDER%')
- git submodule update --init --recursive
- >
sh -c "
pacman --needed --noconfirm -S zip unzip base-devel %PACKAGES% &&
curl -L http://bodge.borodust.org/files/install.sh | sh
"
- pacman --needed --noconfirm -S zip unzip base-devel %PACKAGES%
- curl -L http://bodge.borodust.org/files/install.sh | sh

build_script:
- set TARGET_ARTIFACT=lib%NAME%.dll.bodged-%TARGET_ARCH%-windows-%APPVEYOR_REPO_TAG_NAME%
- set TARGET_SPEC=%TARGET_ARTIFACT%-spec.zip
- >
sh -c "
cd src/lib/
&& cmake -G \"Unix Makefiles\" -DCMAKE_C_FLAGS=%CFLAGS% -DCMAKE_BUILD_TYPE=Release
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON
-DLIBRARY_OUTPUT_PATH=$APPVEYOR_BUILD_FOLDER/src/lib/ -DGLFW_BUILD_TESTS=OFF
-DGLFW_BUILD_DOCS=OFF -DGLFW_INSTALL=OFF -DGLFW_BUILD_EXAMPLES=OFF .
&& make"
&& make
&& ~/.bodge/bin/lisp regen-local-spec-and-zip --arch %TARGET_ARCH% \"$(cygpath -u '%APPVEYOR_BUILD_FOLDER%')\" %ASDF_SYSTEM% \"$(cygpath -u '%APPVEYOR_BUILD_FOLDER%\%TARGET_SPEC%')\""
- mv %APPVEYOR_BUILD_FOLDER%\src\lib\lib%NAME%.dll.bodged %APPVEYOR_BUILD_FOLDER%\%TARGET_ARTIFACT%

artifacts:
- path: $(TARGET_ARTIFACT)
name: target_artifact
- path: $(TARGET_SPEC)
name: target_spec

deploy:
provider: GitHub
Expand All @@ -56,7 +57,7 @@ deploy:
description: $(APPVEYOR_REPO_COMMIT_MESSAGE)
auth_token:
secure: Z5XWjDOBlCrmfz3SQAjnLKtdgI5B2b/owJhRPNWYGrI+qwVNbBc4cZiroBZReWP7
artifact: target_artifact
artifact: target_artifact, target_spec
force_update: true
draft: false
prerelease: false
Expand Down
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ env:
global:
- NAME: glfw
- ASDF_SYSTEM: bodge-glfw
- PATH: ~/.bodge/bin/:$PATH
- secure: Yug8ZSWsbZKP6p5AbVZ3TG2XiukvZpZPc6K3er+b+576lYhJqgs9EI6wCMsfZtXV8A/Ez+49iW0dEBABOHCNe5mvX6Kr4vACoqywVmJ7IVvpt6hpqNjbQ/nMEdLaf/izxrnL8YKqU8qYcF+aJc4T3EOaz5nKgt2pfZuXgpwSbOhRhQbPxjJ45gyqvYJbccvk72h1WrFnU926EfQ7THb/7VHJLidH+eH5GE+mLj9NY1tZYqNI0LTApVkTBxkfvz8gAC8ZR30W/eitah/cEzBROuvmspvU8CpOib2sfQdm3XDJ0LMo7kwlfUbNshM9l2gNzruwWoDOEtGspnb4Rixll3ZzLFRrlTmlV2a2NfKLCcyeakvRiYzrmcZu8lr3Ve0pZ3WYP2c6a1CnU6FL6kVxEJ+D+EXJLmfIZbZDkxbV39ui+PgaRdQ/CUijVfyn/2XZf8FwJpdJhYSJyznPeAg+7C1U2ea+f2smoAHv/Y7TtetqQip/O8ycKnCfUT6TRZ5JRslY75s8qZE3Q/6XQWWfO3rigrGSKL5tuN4uoB3OM5JeN9m7p1ltklaXh6Mfiph8/WnLtlAFGKh2B9RuOPU3ffcIYudHIy7dVPuGkVwdvbQuroDQZEnrxO5ptefT8qlaKJzs/aczlgm9F6qKu1p/BS5XAJjvWj9g1oulWAwctRU=

matrix:
Expand Down Expand Up @@ -48,11 +49,11 @@ before_install:
fi
install:
- git submodule update --init --recursive
- curl -L http://bodge.borodust.org/files/install.sh | sh
- ln -s $TRAVIS_BUILD_DIR/ ~/quicklisp/local-projects/$ASDF_SYSTEM

script:
- export TARGET_FILE=$TRAVIS_BUILD_DIR/lib$NAME.$EXTENSION.bodged-$TARGET_ARCH-$TRAVIS_OS_NAME-$TRAVIS_BRANCH
- export TARGET_SPEC=$TARGET_FILE-spec.zip
- >
cd $TRAVIS_BUILD_DIR/src/lib/ && cmake -G "Unix Makefiles" \
-DCMAKE_C_FLAGS=$(CFLAGS) \
Expand All @@ -65,9 +66,9 @@ script:
-DGLFW_INSTALL=OFF \
-DGLFW_BUILD_EXAMPLES=OFF . && \
make
- lisp regen-local-spec-and-zip --arch $TARGET_ARCH "$TRAVIS_BUILD_DIR" $ASDF_SYSTEM "$TARGET_SPEC"

before_deploy:
- export TARGET_FILE=$TRAVIS_BUILD_DIR/lib$NAME.$EXTENSION.bodged-$TARGET_ARCH-$TRAVIS_OS_NAME-$TRAVIS_BRANCH
- mv $TRAVIS_BUILD_DIR/src/lib/$OUTPUT_FILE $TARGET_FILE
- >
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
Expand All @@ -78,7 +79,7 @@ before_deploy:
deploy:
provider: releases
api-key: $GITHUB_TOKEN
file: [$TARGET_FILE]
file: [$TARGET_FILE, $TARGET_SPEC]
skip_cleanup: true
overwrite: true
on:
Expand Down
2 changes: 0 additions & 2 deletions util/regen-spec.lisp

This file was deleted.

36 changes: 3 additions & 33 deletions util/update-specs.sh
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
#!/usr/bin/env bash

name=glfw
repository_url=https://github.com/borodust/bodge-glfw


if [[ -z $1 ]] ; then
echo "Version is not provided!"
exit 1;
fi

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

declare -A platforms
platforms=(["linux"]="so" ["osx"]="dylib" ["windows"]="dll")

declare -A archs
archs=(["x86_64"]="x86_64" ["i686"]="i686")

for arch in "${!archs[@]}" ; do
for platform in "${!platforms[@]}" ; do
lib="lib$name.${platforms[$platform]}.bodged"
url="$repository_url/releases/download/$1/$lib-$arch-$platform-$1"

spec_dir="$script_dir/"
spec_url="$url-spec.zip"
spec_archive=$(mktemp /tmp/$lib-spec.XXXXXXXX)
mkdir -p "$spec_dir"

echo "Downloading $lib spec from $spec_url to $spec_archive"
if ! wget -O "$spec_archive" -q "$spec_url" ; then
echo "$lib spec download failed"
exit 1;
fi
( cd $spec_dir && unzip -o $spec_archive )
done
done
lisp download-specs --lib-postfix ".bodged" \
glfw https://github.com/borodust/bodge-glfw \
"$script_dir/../src/spec/" $1

0 comments on commit 4a64e63

Please sign in to comment.