Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
borodust committed Jan 21, 2018
0 parents commit ec1245e
Show file tree
Hide file tree
Showing 21 changed files with 233 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
image:
- Visual Studio 2017

environment:
global:
NAME: glfw
matrix:
- platform: x64
ARCH: x86_64
CFLAGS: -m64
PATH: C:\msys64\mingw64\bin\;C:\msys64\usr\bin\;$(PATH)
PACKAGES: mingw-w64-i686-toolchain mingw-w64-i686-cmake
- platform: x86
ARCH: i686
CFLAGS: -m32
PATH: C:\msys64\mingw32\bin\;C:\msys64\usr\bin\;$(PATH)
PACKAGES: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake

skip_non_tags: true

branches:
only:
- master
- "/^v\\d+(\\.\\d+)+$/"

install:
- git submodule update --init --recursive

build_script:
- set TARGET_ARTIFACT=lib%NAME%.dll.bodged-%ARCH%-windows-%APPVEYOR_REPO_TAG_NAME%
- pacman -S --needed --noconfirm base-devel %PACKAGES%
- sh -c "cd 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/lib -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DGLFW_INSTALL=OFF -DGLFW_BUILD_EXAMPLES=OFF . && make"
- mv %APPVEYOR_BUILD_FOLDER%\lib\lib%NAME%.dll.bodged %APPVEYOR_BUILD_FOLDER%\%TARGET_ARTIFACT%

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

deploy:
provider: GitHub
release: $(APPVEYOR_REPO_TAG_NAME)
tag: $(APPVEYOR_REPO_TAG_NAME)
description: $(APPVEYOR_REPO_COMMIT_MESSAGE)
auth_token:
secure: Z5XWjDOBlCrmfz3SQAjnLKtdgI5B2b/owJhRPNWYGrI+qwVNbBc4cZiroBZReWP7
artifact: target_artifact
force_update: true
draft: false
prerelease: false
on:
appveyor_repo_tag: true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spec/*.spec linguist-vendored
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# lisp junk
*.FASL
*.fasl
*.lisp-temp

# emacs junk
\#*
*~
.\#*

# system dependent junk
local/

# blobs
*.so.*
*.dll.*
*.dylib.*
lib/build/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/glfw"]
path = lib/glfw
url = https://github.com/glfw/glfw.git
68 changes: 68 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
language: c
sudo: false

addons:
apt:
packages:
- gcc-multilib
- xorg-dev

env:
global:
- NAME: glfw
- 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:
include:
- os: linux
env:
- ARCH=i686
- CFLAGS=-m32
- EXTENSION=so
- os: linux
env:
- ARCH=x86_64
- CFLAGS=-m64
- EXTENSION=so
- os: osx
env:
- ARCH=i686
- CFLAGS=-m32
- EXTENSION=dylib
- os: osx
env:
- ARCH=x86_64
- CFLAGS=-m64
- EXTENSION=dylib

branches:
only:
- "/^v\\d+(\\.\\d+)+$/"


script:
- >
cd 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=$TRAVIS_BUILD_DIR/lib \
-DGLFW_BUILD_TESTS=OFF \
-DGLFW_BUILD_DOCS=OFF \
-DGLFW_INSTALL=OFF \
-DGLFW_BUILD_EXAMPLES=OFF . && \
make
before_deploy:
- export TARGET_FILE=$TRAVIS_BUILD_DIR/lib$NAME.$EXTENSION.bodged-$ARCH-$TRAVIS_OS_NAME-$TRAVIS_BRANCH
- mv $TRAVIS_BUILD_DIR/lib/lib$NAME.$EXTENSION.bodged $TARGET_FILE

deploy:
provider: releases
api-key: $GITHUB_TOKEN
file: $TARGET_FILE
skip_cleanup: true
overwrite: true
on:
tags: true
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Pavel Korolev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# bodge glfw wrapper

Thin wrapper over [`GLFW`](http://chipmunk-physics.net/) OS abstraction and GL/Vulkan context
handling library.

# Requirements

* ASDF/Quicklisp
* x86_64/i686 GNU/Linux, macOS or Windows

# Loading
```lisp
(ql:quickload '(glfw-blob bodge-glfw))
```
14 changes: 14 additions & 0 deletions bodge-glfw.asd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(asdf:defsystem bodge-glfw
:description "Wrapper over glfw3 library"
:version "1.0.0"
:author "Pavel Korolev"
:mailto "[email protected]"
:license "MIT"
:depends-on (alexandria cffi claw)
:serial t
:components ((:file "packages")
(:file "libglfw")
(:static-file "bodge_glfw.h")
(:file "claw")
(:file "glfw")
(:module spec)))
6 changes: 6 additions & 0 deletions bodge_glfw.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef _BODGE_CHIPMUNK_H_
#define _BODGE_CHIPMUNK_H_

#include <GLFW/glfw3.h>

#endif /* _BODGE_CHIPMUNK_H_ */
7 changes: 7 additions & 0 deletions claw.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(claw:c-include "bodge_glfw.h" bodge-glfw
:in-package :%glfw
:include-definitions ("(glfw|GLFW)\\w*")
:exclude-definitions ("(GL|gl)(?!(FW|fw))\\w*"
"^PFN\\w*"
"glfwGetProcAddress")
:rename-symbols (claw:by-removing-prefixes "glfw" "GLFW" "GLFW_"))
1 change: 1 addition & 0 deletions glfw.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(in-package :glfw)
11 changes: 11 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.0.0)

project(glfw.bodged)

add_subdirectory(glfw)

set_target_properties(glfw PROPERTIES
OUTPUT_NAME glfw
VERSION bodged
SOVERSION bodged
POSITION_INDEPENDENT_CODE ON)
1 change: 1 addition & 0 deletions lib/glfw
Submodule glfw added at 999f35
5 changes: 5 additions & 0 deletions libglfw.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(cffi:define-foreign-library (glfw:libglfw
:search-path (asdf:system-relative-pathname :bodge-glfw "lib/"))
(:darwin "libglfw.dylib.bodged")
(:unix "libglfw.so.bodged")
(:windows "libglfw.dll.bodged"))
6 changes: 6 additions & 0 deletions packages.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(cl:defpackage :%glfw
(:use))

(cl:defpackage :glfw
(:use :cl :claw :alexandria)
(:export libglfw))
1 change: 1 addition & 0 deletions spec/bodge_glfw.i686-apple-darwin-gnu.spec

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions spec/bodge_glfw.i686-pc-linux-gnu.spec

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions spec/bodge_glfw.i686-pc-windows-gnu.spec

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions spec/bodge_glfw.x86_64-apple-darwin-gnu.spec

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions spec/bodge_glfw.x86_64-pc-linux-gnu.spec

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions spec/bodge_glfw.x86_64-pc-windows-gnu.spec

Large diffs are not rendered by default.

0 comments on commit ec1245e

Please sign in to comment.