From 44376c04fa8ed5bc9ca48598afa1d177d169fa32 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Wed, 11 Oct 2017 22:33:09 +0200 Subject: Generate and install pkg-config pc file After installation, compiling new programs is possible with $ cc game.c `pkg-config --static --libs --cflags raylib` or $ cc game.c `pkg-config --libs --cflags raylib` depending on configuration Also adds following configuration options: - WITH_PIC "Compile static library as position-independent code" - STATIC_RAYLIB "Build raylib as a static library" - MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" --- raylib.pc.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 raylib.pc.in (limited to 'raylib.pc.in') diff --git a/raylib.pc.in b/raylib.pc.in new file mode 100644 index 00000000..0472c283 --- /dev/null +++ b/raylib.pc.in @@ -0,0 +1,13 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: raylib +Description: Simple and easy-to-use library to learn videogames programming +URL: https://github.com/raysan5/raylib +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -lraylib +Libs.private:@PKG_CONFIG_LIBS_PRIVATE@ +Requires.private: +Cflags: -I${includedir} -- cgit v1.2.3 From 49c5a433df48c1b9efafb70e51724c2fc3a5e608 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Fri, 24 Nov 2017 19:57:44 +0100 Subject: Setup CMake package target and CI auto-deploy tags cmake --build . --target package # or make package if make is used can now be used to create binary packages for raylib. AppVeyor and Travis CI are configured to push the artifacts that result from building git tags to the related Github releases page. --- .travis.yml | 52 ++++++++++++++++++++++++++++-------------------- README.md | 10 ++++++---- appveyor.yml | 58 ++++++++++++++++++++++++++++-------------------------- raylib.pc.in | 2 +- src/CMakeLists.txt | 16 +++++++++++++-- 5 files changed, 82 insertions(+), 56 deletions(-) (limited to 'raylib.pc.in') diff --git a/.travis.yml b/.travis.yml index ce4998c7..40817fba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,38 +12,48 @@ os: env: global: - VERBOSE=1 - matrix: - - CFLAGS=-m64 SHARED=ON - - CFLAGS=-m32 SHARED=OFF -# We don't install x11 32-bit libraries, so skip shared libraries on -m32 + matrix: # We don't install x11 32-bit libraries, so skip shared libraries on -m32 + - ARCH=i386 SHARED=OFF + - ARCH=amd64 SHARED=ON + +matrix: + exclude: # This is already covered by building universal (fat) libraries by default + - os: osx + env: ARCH=i386 SHARED=OFF + before_script: - - export CFLAGS="-std=gnu99 $CFLAGS" + - export CFLAGS="-std=gnu99" before_install: - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y gcc-multilib libopenal-dev libxcursor-dev libxinerama-dev - mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev; + mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev + libgl1-mesa-dev libglu1-mesa-dev libglew-dev; + export RAYLIB_PACKAGE_SUFFIX="-Linux-$ARCH"; + if [ "$ARCH" == "i386" ]; then export CFLAGS="$CFLAGS -m32"; fi; + if [ "$ARCH" == "amd64" ]; then export CFLAGS="$CFLAGS -m64"; fi; fi - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; brew install glfw; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export RAYLIB_PACKAGE_SUFFIX="-macOS"; fi - "$CC --version" script: - mkdir build - cd build - - cmake -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=$SHARED -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. + - cmake -DMACOS_FATLIB=ON -DSTATIC_RAYLIB=ON -DSHARED_RAYLIB=$SHARED -DBUILD_EXAMPLES=OFF -DBUILD_GAMES=OFF .. - make -# - make package -# - sudo make install -# -#deploy: -# provider: releases -# api_key: -# secure: XXX -# file_glob: true -# file: raylib-*.tar.gz -# skip_cleanup: true -# on: -# branch: master -# tags: true + - make package + +deploy: + provider: releases + api_key: + secure: LvqUIAN/3dJul+Ra2iK3tSaNG5IwsNMmGIwVMy0DK5IBCxiQPBc9pWGiE30RTBPt6Z+N4BhMEE8DtUl+vnISlMoHWNIIhF2zwC66hs/F7zY7qEITMRSmfiLcqxQysknFOnJB06CATgXcFqlEo9j+t4abrG/f3qcb92J4O2uNz336Au2myTx93Q5MxbyA7KiUuEutFnb2dWiPCY4d+sGeXEfsiD2R7aj/8MaWOkoGdZVrTkI9juMgvpImkjQBArvqdjUMeT3MsRrwgOIq5v2GFV9dOl8k1WzPeT8B2JHh00ed/o1/wuFq/cLLOxtYo2+Pv3+xatOrlexoX0WkDm7C9/L1W5U4rLexU3CQ9mMBmHPnp6k/WXZ5QXEE4uUF0+LpN3XlIXzFpdZmZiVV8VLxg2WvyncMmivYiu7/MTkyfZxyKkzwl7sZZslzHA9kOGedGaN7b7/2B77OFHoQK8lKfdFml7jJnarh+89nenNZYMab0E8qkOJOyb2bYlDTa0/2nyxGiyymYgq6YHLNrDbhqB/1LzdgzjMliQ8ri5q9Ux2vjfcqOzhfAmcwFwnY/D6yXJWYi0DWpHZdpKl3du6dYDrypW91/yDWbwiJ/YhrE7ZunzrcB6GH/QkbuzWxdCth39rQAHih8DG01co/K3Gvi4yGjvIH5tFUpyEolMnpMiA= + file_glob: true + file: raylib-*.tar.gz + skip_cleanup: true + on: + repo: raysan5/raylib + branch: + - develop + - master diff --git a/README.md b/README.md index 0be62fda..1c078f52 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ features * Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD) * Multiple platforms support: Windows, Linux, Mac, **Android**, **Raspberry Pi** and **HTML5** * VR stereo rendering support with configurable HMD device parameters - * Minimal external dependencies (GLFW3, OpenGL, OpenAL) + * Minimal external dependencies (OpenGL, OpenAL) * Complete bindings to LUA ([raylib-lua](https://github.com/raysan5/raylib-lua)) and Go ([raylib-go](https://github.com/gen2brain/raylib-go)) raylib uses on its core module the outstanding [GLFW3](http://www.glfw.org/) library. The best option I found for @@ -44,10 +44,12 @@ to accomodate to Android, Raspberry Pi and HTML5. *On Raspberry Pi, Videocore API and EGL libraries are used for window/context management and raw inputs reading.* -building --------- +build and installation +---------------------- + +Binary releases for Windows, Linux and macOS are available at the [Github Releases](https://github.com/raysan5/raylib/releases) page. -For detailed building instructions, check [raylib Wiki](https://github.com/raysan5/raylib/wiki). +To build raylib yourself, check out the [raylib Wiki](https://github.com/raysan5/raylib/wiki) for detailed instructions. raylib has been developed using exclusively two tools: diff --git a/appveyor.yml b/appveyor.yml index 864d0c68..2363bd3f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,29 +10,30 @@ init: - cmake -E remove c:\programdata\chocolatey\bin\cpack.exe - set PATH=%PATH:C:\Program Files (x86)\Git\usr\bin;=% - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% - - set PATH=%prefix_dir%\bin;%PATH% + - if [%BITS%]==[32] set MINGW=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32 + - if [%BITS%]==[64] set MINGW=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64 + - if [%COMPILER%]==[mingw] set PATH=%MINGW%\bin;%PATH% + - set RAYLIB_PACKAGE_SUFFIX=-Win%BITS%-%COMPILER% + - set VERBOSE=1 environment: matrix: - - compiler: MinGW-w64 + - compiler: mingw bits: 32 - prefix_dir: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32 - - compiler: MinGW-w64 + - compiler: mingw bits: 64 - prefix_dir: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64 - - compiler: MSVC15 + - compiler: msvc15 bits: 32 - - compiler: MSVC15 + - compiler: msvc15 bits: 64 before_build: - appveyor DownloadFile http://openal-soft.org/openal-binaries/openal-soft-1.17.2-bin.zip - 7z x openal-soft-1.17.2-bin.zip - move openal-soft-1.17.2-bin src\external\openal - - if [%COMPILER%]==[MinGW-w64] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles" - - if [%COMPILER%]==[MSVC15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015" - - if [%COMPILER%]==[MSVC15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64" - - set VERBOSE=1 + - if [%compiler%]==[mingw] set CFLAGS=-m%BITS% & set LDFLAGS=-m%BITS% & set GENERATOR="MinGW Makefiles" + - if [%COMPILER%]==[msvc15] if [%BITS%]==[32] set GENERATOR="Visual Studio 14 2015" + - if [%COMPILER%]==[msvc15] if [%BITS%]==[64] set GENERATOR="Visual Studio 14 2015 Win64" - mkdir build - cd build @@ -41,25 +42,26 @@ build_script: - cmake --build . --target install after_build: -# - cmake --build . --target package + - cmake --build . --target package before_test: test_script: -#artifacts: -# - path: 'build\*.zip' -# -#deploy: -# description: 'Automatic build by CI' -# provider: GitHub -# auth_token: -# secure: XXX -# artifact: /.*\.zip/ -# draft: false -# prerelease: false -# force_update: true -# on: -# branch: master -# appveyor_repo_tag: true # deploy on tag push only -# +artifacts: + - path: 'build\*.zip' + +deploy: + description: 'Automatic build by CI' + provider: GitHub + auth_token: + secure: lqkfPGZPK828Mmopbicrng08QaaQXAshp0a9E3bMXt8+hpA8vCfDAT3jgU8kaSsW + artifact: /.*\.zip/ + draft: false + prerelease: false + force_update: true + on: + branch: + - master + - develop + appveyor_repo_tag: true # deploy on tag push only diff --git a/raylib.pc.in b/raylib.pc.in index 0472c283..93984363 100644 --- a/raylib.pc.in +++ b/raylib.pc.in @@ -5,7 +5,7 @@ includedir=${prefix}/include Name: raylib Description: Simple and easy-to-use library to learn videogames programming -URL: https://github.com/raysan5/raylib +URL: http://github.com/raysan5/raylib Version: @PROJECT_VERSION@ Libs: -L${libdir} -lraylib Libs.private:@PKG_CONFIG_LIBS_PRIVATE@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b29c29fc..1fec104f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,8 +2,7 @@ project(raylib) include("../utils.cmake") -set(raylib_VERSION_MAJOR 1) -set(raylib_VERSION_MINOR 8) +set(PROJECT_VERSION 1.9.0dev) set(RAYLIB raylib) # Name of the generated library @@ -173,3 +172,16 @@ message(STATUS "Compiling with the flags:") message(STATUS " PLATFORM=" ${PLATFORM}) message(STATUS " GRAPHICS=" ${GRAPHICS}) +# Packaging +SET(CPACK_PACKAGE_NAME "raylib") +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simple and easy-to-use library to learn videogames programming") +SET(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") +SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") +SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") +SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") +SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/../README.md") +SET(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/../README.md") +SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE.md") +SET(CPACK_PACKAGE_FILE_NAME "raylib-${PROJECT_VERSION}$ENV{RAYLIB_PACKAGE_SUFFIX}") +SET(CPACK_GENERATOR "ZIP;TGZ") # Remove this, if you want the NSIS installer on Windows +include(CPack) -- cgit v1.2.3 From 1be72a2e72bcae18241d4a6dd6427aeaaf54e4d5 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sun, 11 Feb 2018 20:00:04 +0100 Subject: pkg-config: Empty Requires.private on shared-only build If user doesn't build the static library, `pkg-config --static --libs raylib` should be equivalent to `pkg-config --libs raylib`. --- raylib.pc.in | 2 +- src/CMakeLists.txt | 4 +++- utils.cmake | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'raylib.pc.in') diff --git a/raylib.pc.in b/raylib.pc.in index 93984363..d71a5e2c 100644 --- a/raylib.pc.in +++ b/raylib.pc.in @@ -8,6 +8,6 @@ Description: Simple and easy-to-use library to learn videogames programming URL: http://github.com/raysan5/raylib Version: @PROJECT_VERSION@ Libs: -L${libdir} -lraylib -Libs.private:@PKG_CONFIG_LIBS_PRIVATE@ +Libs.private: @PKG_CONFIG_LIBS_PRIVATE@ Requires.private: Cflags: -I${includedir} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e9784ff4..40871455 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -137,6 +137,8 @@ if(${PLATFORM} MATCHES "PLATFORM_DESKTOP") PUBLIC ${GRAPHICS} ) + set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE}) + if (WITH_PIC) set_property(TARGET ${RAYLIB} PROPERTY POSITION_INDEPENDENT_CODE ON) endif() @@ -149,7 +151,7 @@ if(${PLATFORM} MATCHES "PLATFORM_DESKTOP") configure_file(../raylib.pc.in raylib.pc @ONLY) install(FILES ${CMAKE_BINARY_DIR}/release/raylib.pc DESTINATION lib/pkgconfig) - + # Copy the header files to the build directory file(COPY "raylib.h" DESTINATION ".") file(COPY "rlgl.h" DESTINATION ".") diff --git a/utils.cmake b/utils.cmake index dd4160d3..2c6a3771 100644 --- a/utils.cmake +++ b/utils.cmake @@ -74,8 +74,8 @@ foreach(L ${LIBS_PRIVATE}) set(LASTDIR ${DIR}) - set(PKG_CONFIG_LIBS_PRIVATE ${PKG_CONFIG_LIBS_PRIVATE} ${DIR_OPT} ${FILE_OPT}) - string (REPLACE ";" " " PKG_CONFIG_LIBS_PRIVATE "${PKG_CONFIG_LIBS_PRIVATE}") + set(__PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${DIR_OPT} ${FILE_OPT}) + string (REPLACE ";" " " __PKG_CONFIG_LIBS_PRIVATE "${__PKG_CONFIG_LIBS_PRIVATE}") endforeach(L) @@ -86,7 +86,7 @@ function(link_libraries_to_executable executable) if (TARGET raylib_shared) target_link_libraries(${executable} raylib_shared) else() - target_link_libraries(${executable} raylib ${PKG_CONFIG_LIBS_PRIVATE}) + target_link_libraries(${executable} raylib ${__PKG_CONFIG_LIBS_PRIVATE}) endif() endfunction() -- cgit v1.2.3