Skip to content

Commit

Permalink
Manual building and environment adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
philippj committed Jan 7, 2020
1 parent f3ebddf commit f6209d7
Show file tree
Hide file tree
Showing 71 changed files with 101 additions and 37,706 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
*.pyc
*.pyc
*.dll
*.so
*.dylib
!redist/windows/*.dll
!redist/osx/*.dylib
!redist/linux/*.so
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SteamworksPy ![alt text](https://api.travis-ci.org/Gramps/SteamworksPy.svg?branch=master)
# SteamworksPy
Howdy! This project originally started as a fork of Easimer's SteamworksForPython in an attempt to bring a fully-functional Python module for Steam out for the public. Since then it has grown beyond that and added a lot of functionality.

Feel free to fork or contribute to this module.
Expand Down
61 changes: 61 additions & 0 deletions build_win_64.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@echo off
echo [*] Building SteamworksPy

:check_arguments
if %1=="" (
echo [!] Please call this script with your Visual Studio Version as argument!
exit /B 5
)
goto setup_environment

:setup_environment
echo [*] Setting up environment
if not exist "C:\Program Files (x86)\Microsoft Visual Studio\%1\BuildTools\Common7\Tools\VsDevCmd.bat" (
echo [!] Could not find your Visual Studio %1 installation!
exit /B 5
)
call "C:\Program Files (x86)\Microsoft Visual Studio\%1\BuildTools\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
call "C:\Program Files (x86)\Microsoft Visual Studio\%1\BuildTools\Common7\Tools\VsDevCmd.bat" -test
goto check_for_steamworks

:steamworks_missing
echo [!] Your environment is not properly set up!
echo [!] Please follow the instructions in SteamworksPy\library\README.md
exit /B 5

:check_for_steamworks
dir /b /a "library\sdk\steam\*.h" | >nul findstr "^" && (echo [*] SDK available) || (goto steamworks_missing)
if not exist .\library\sdk\redist\steam_api64.dll (
goto steamworks_missing
)
if not exist .\library\sdk\redist\steam_api64.lib (
goto steamworks_missing
)
goto main

:main
SET dirname=_build_%random%
echo [*] Building in %dirname%
mkdir %dirname%

echo [*] Copying SteamworksPy.cpp into build root
copy ".\library\SteamworksPy.cpp" ".\%dirname%\SteamworksPy.cpp"

echo [*] Copying Steamworks redist bins to build root
copy ".\library\sdk\redist\*" ".\%dirname%\"

echo [*] Linking SteamworksSDK into build root
mklink /J ".\%dirname%\sdk" ".\library\sdk\steam"

cd %dirname%

echo [*] Building SteamworksPy.dll
cl.exe /D_USRDLL /D_WINDLL SteamworksPy.cpp steam_api64.lib /link /DLL /OUT:SteamworksPy64.dll

echo [*] Moving finished library into main repo
move "SteamworksPy64.dll" "..\redist\windows\."

cd ..

echo [*] Cleanup
rmdir /S /Q %dirname%
13 changes: 13 additions & 0 deletions library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Building SteamworksPy

### Prerequisites
The Steamworks source files are required for building the SteamworksPy libraries and those are only available to
Steamworks account holders.

A Steamworks account is free and can be registered at https://partner.steamgames.com

The source files can be downloaded here (log-in required): https://partner.steamgames.com/downloads/steamworks_sdk_147.zip (v1.47)

Unpack the archive and place the contents of:
- /sdk/public/steam in SteamworksPy/library/sdk/steam
- /sdk/redistributable_bin/%your_os% in SteamworksPy/library/sdk/redist
8 changes: 4 additions & 4 deletions library/SteamworksPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
//
// Include the Steamworks API header
#if defined( _WIN32 )
#include "steam\steam_api.h"
#include "sdk\steam_api.h"
#define SW_PY extern "C" __declspec(dllexport)
#elif defined( __APPLE__ )
#include "steam/steam_api.h"
#include "sdk/steam_api.h"
#include "TargetConditionals.h"
#define SW_PY extern "C" __attribute__ ((visibility("default")))
#elif defined( __linux__ )
#include "steam/steam_api.h"
#include "sdk/steam_api.h"
#define SW_PY extern "C" __attribute__ ((visibility("default")))
#else
#error "Unsupported platform"
Expand Down Expand Up @@ -425,7 +425,7 @@ GetAppOwner() {
return cSteamID.ConvertToUint64();
}

// Gets the associated launch parameter if the game is run via steam://run/<appid>/?param1=value1;param2=value2;param3=value3 etc.
// Gets the associated launch parameter if the game is run via sdk://run/<appid>/?param1=value1;param2=value2;param3=value3 etc.
SW_PY const char *GetLaunchQueryParam(const char *key) {
if (SteamApps() == NULL) {
return "";
Expand Down
36 changes: 0 additions & 36 deletions library/build/kit/build_windows.bat

This file was deleted.

Binary file removed library/build/steamworks/redist/libsteam_api.dylib
Binary file not shown.
Binary file removed library/build/steamworks/redist/libsteam_api.so
Binary file not shown.
Binary file removed library/build/steamworks/redist/steam_api64.dll
Binary file not shown.
Binary file removed library/build/steamworks/redist/steam_api64.lib
Binary file not shown.
67 changes: 0 additions & 67 deletions library/build/steamworks/steam/isteamapplist.h

This file was deleted.

Loading

0 comments on commit f6209d7

Please sign in to comment.