Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
94324625
Commit
94324625
authored
7 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
WindowsBuild: Install Gajim as a python package
parent
4ffc1cf8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
win/_base.sh
+5
-1
5 additions, 1 deletion
win/_base.sh
win/misc/create-launcher.py
+15
-17
15 additions, 17 deletions
win/misc/create-launcher.py
win/misc/gajim-portable.nsi
+2
-2
2 additions, 2 deletions
win/misc/gajim-portable.nsi
with
22 additions
and
20 deletions
win/_base.sh
+
5
−
1
View file @
94324625
...
...
@@ -29,6 +29,7 @@ function set_build_root {
BUILD_ROOT
=
"
$1
"
REPO_CLONE
=
"
${
BUILD_ROOT
}
/
${
MINGW
}
"
/gajim
MINGW_ROOT
=
"
${
BUILD_ROOT
}
/
${
MINGW
}
"
PACKAGE_DIR
=
"
${
BUILD_ROOT
}
/
${
MINGW
}
/lib/python3.6/site-packages"
}
set_build_root
"
${
DIR
}
/_build_root"
...
...
@@ -120,8 +121,10 @@ pillow
function
install_gajim
{
[
-z
"
$1
"
]
&&
(
echo
"Missing arg"
;
exit
1
)
rm
-Rf
"
${
PACKAGE_DIR
}
/gajim"
rm
-Rf
"
${
REPO_CLONE
}
"
git clone
"
${
DIR
}
"
/..
"
${
REPO_CLONE
}
"
mv
"
${
REPO_CLONE
}
/gajim"
"
${
PACKAGE_DIR
}
"
(
cd
"
${
REPO_CLONE
}
"
&&
git checkout
"
$1
"
)
||
exit
1
...
...
@@ -186,6 +189,7 @@ function cleanup_install {
-exec
rm
-f
{}
\;
rm
-Rf
"
${
REPO_CLONE
}
"
/.git
rm
-Rf
"
${
REPO_CLONE
}
"
/.gitlab-ci.yml
rm
-Rf
"
${
REPO_CLONE
}
"
/debian
rm
-Rf
"
${
REPO_CLONE
}
"
/doc
rm
-Rf
"
${
REPO_CLONE
}
"
/m4
...
...
@@ -313,7 +317,7 @@ function cleanup_install {
find
"
${
MINGW_ROOT
}
"
/bin
-name
"*.pyo"
-exec
rm
-f
{}
\;
find
"
${
MINGW_ROOT
}
"
/bin
-name
"*.pyc"
-exec
rm
-f
{}
\;
build_compileall
-q
"
${
MINGW_ROOT
}
"
find
"
${
MINGW_ROOT
}
"
-name
"*.py"
!
-name
"gajim.py"
!
-name
"history_manager.py"
!
-name
"*theme.py"
-exec
rm
-f
{}
\;
find
"
${
MINGW_ROOT
}
"
-name
"*.py"
!
-name
"*theme.py"
-exec
rm
-f
{}
\;
find
"
${
MINGW_ROOT
}
"
/bin
-name
"*.pyc"
-exec
rm
-f
{}
\;
find
"
${
MINGW_ROOT
}
"
-type
d
-name
"__pycache__"
-prune
-exec
rm
-rf
{}
\;
...
...
This diff is collapsed.
Click to expand it.
win/misc/create-launcher.py
+
15
−
17
View file @
94324625
...
...
@@ -58,7 +58,7 @@ def build_exe(source_path, resource_path, is_gui, out_path):
subprocess
.
check_call
(
args
)
def
get_launcher_code
(
entry_point
):
def
get_launcher_code
():
template
=
"""
\
#include
"
Python.h
"
#define WIN32_LEAN_AND_MEAN
...
...
@@ -87,19 +87,17 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
Py_FrozenFlag = 1;
Py_Initialize();
PySys_SetArgvEx(__argc, szArglist, 0);
FILE* file = fopen(
"
../gajim/gajim/%(filename)s
"
,
"
r
"
);
PyRun_SimpleString(
"
import sys; import os;
"
"
os.chdir(
'
../gajim/gajim
'
);
"
"
sys.path.append(os.getcwd());
"
"
sys.frozen=True;
"
);
result = PyRun_SimpleFile(file,
"
../gajim/gajim/%(filename)s
"
);
result = PyRun_SimpleString(
"
import sys; import os;
"
"
sys.frozen=True;
"
"
os.chdir(
'
../gajim
'
);
"
"
import gajim.gajim as g;
"
"
g.GajimApplication().run(sys.argv);
"
);
Py_Finalize();
return result;
}
"""
return
template
%
{
"
filename
"
:
entry_point
}
return
template
def
get_resouce_code
(
filename
,
file_version
,
file_desc
,
icon_path
,
...
...
@@ -150,7 +148,7 @@ END
def
build_launcher
(
out_path
,
icon_path
,
file_desc
,
product_name
,
product_version
,
company_name
,
entry_point
,
is_gui
):
company_name
,
is_gui
):
src_ico
=
os
.
path
.
abspath
(
icon_path
)
target
=
os
.
path
.
abspath
(
out_path
)
...
...
@@ -162,7 +160,7 @@ def build_launcher(out_path, icon_path, file_desc, product_name, product_version
try
:
os
.
chdir
(
temp
)
with
open
(
"
launcher.c
"
,
"
w
"
)
as
h
:
h
.
write
(
get_launcher_code
(
entry_point
))
h
.
write
(
get_launcher_code
())
shutil
.
copyfile
(
src_ico
,
"
launcher.ico
"
)
with
open
(
"
launcher.rc
"
,
"
w
"
)
as
h
:
h
.
write
(
get_resouce_code
(
...
...
@@ -188,17 +186,17 @@ def main():
build_launcher
(
os
.
path
.
join
(
target
,
"
Gajim.exe
"
),
os
.
path
.
join
(
misc
,
"
gajim.ico
"
),
"
Gajim
"
,
"
Gajim
"
,
version
,
company_name
,
'
gajim.py
'
,
True
)
version
,
company_name
,
True
)
build_launcher
(
os
.
path
.
join
(
target
,
"
Gajim-Debug.exe
"
),
os
.
path
.
join
(
misc
,
"
gajim.ico
"
),
"
Gajim
"
,
"
Gajim
"
,
version
,
company_name
,
'
gajim.py
'
,
False
)
version
,
company_name
,
False
)
build_launcher
(
os
.
path
.
join
(
target
,
"
history_manager.exe
"
),
os
.
path
.
join
(
misc
,
"
gajim.ico
"
),
"
History Manager
"
,
"
History Manager
"
,
version
,
company_name
,
'
history_manager.py
'
,
True
)
#
build_launcher(
#
os.path.join(target, "history_manager.exe"),
#
os.path.join(misc, "gajim.ico"), "History Manager", "History Manager",
#
version, company_name, 'history_manager.py', True)
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
win/misc/gajim-portable.nsi
+
2
−
2
View file @
94324625
...
...
@@ -105,9 +105,9 @@ Section "Gajim" SecGajim
SetOutPath "$INSTDIR\bin"
CreateShortCut "$INSTDIR\Gajim-Portable.lnk" "$INSTDIR\bin\Gajim.exe" \
"-c
..\
..\UserData" "" "" SW_SHOWNORMAL "" "Gajim Portable"
"-c ..\UserData" "" "" SW_SHOWNORMAL "" "Gajim Portable"
CreateShortCut "$INSTDIR\Gajim-Portable-Debug.lnk" "$INSTDIR\bin\Gajim-Debug.exe" \
"-c
..\
..\UserData" "" "" SW_SHOWNORMAL "" "Gajim Portable Debug"
"-c ..\UserData" "" "" SW_SHOWNORMAL "" "Gajim Portable Debug"
SectionEnd
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment