Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add Linux support #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

[WIP] Add Linux support #83

wants to merge 2 commits into from

Conversation

jkirk
Copy link

@jkirk jkirk commented Jan 30, 2024

scripts/linux/build is a modified version of scripts/windows/build.bat.

It just takes the modified ./scripts/linux/update-version-info.py + the unmodified ./scripts/windows/git-xl-version-info.py files and uses them to build the binary via pyinstaller.

I also updated pytinstaller to fix the following problem:

      ❯ pip install -r requirements.txt
      Collecting colorama==0.3.9
        Using cached colorama-0.3.9-py2.py3-none-any.whl (20 kB)
      Collecting oletools==0.60
        Using cached oletools-0.60-py2.py3-none-any.whl (968 kB)
      ERROR: Ignored the following versions that require a different python version: 4.10 Requires-Python <3.11,>=3.6; 4.6 Requires-Python <3.11,>=3.6; 4.7 Requires-Python <3.11,>=3.6; 4.8 Requires-Python <3.11,>=3.6; 4.9 Requires-Python <3.11,>=3.6; 5.0 Requires-Python <3.11,>=3.7; 5.0.1 Requires-Python <3.11,>=3.7; 5.1 Requires-Python <3.11,>=3.7; 5.2 Requires-Python <3.11,>=3.7; 5.3 Requires-Python <3.11,>=3.7; 5.4 Requires-Python <3.11,>=3.7; 5.4.1 Requires-Python <3.11,>=3.7
      ERROR: Could not find a version that satisfies the requirement pyinstaller==4.10 (from versions: 2.0, 2.1, 3.0, 3.1, 3.1.1, 3.2, 3.2.1, 3.3, 3.3.1, 3.4, 3.5, 3.6, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.5.1, 5.5, 5.6, 5.6.1, 5.6.2, 5.7.0, 5.8.0, 5.9.0, 5.10.0, 5.10.1, 5.11.0, 5.12.0, 5.13.0, 5.13.1, 5.13.2, 6.0.0, 6.1.0, 6.2.0, 6.3.0)
      ERROR: No matching distribution found for pyinstaller==4.10

It builds:

❯ scripts/linux/build                 
-----------                                                         
Version tag: 0.0.0                                                                                                                      
Build number: 0                                                                                                                         
Commit hash: dev                                                                                                                        
Generate file version: 0.0.0.0                                      
-----------                                                         
81 INFO: PyInstaller: 6.3.0                                                                                                             
81 INFO: Python: 3.11.2                                                                                                                 
82 INFO: Platform: Linux-6.1.0-17-amd64-x86_64-with-glibc2.36                                                                           
82 INFO: wrote /home/jkirk/projects/python-dev/git-xl/git-xl-diff-x64.spec                                                              
83 INFO: Extending PYTHONPATH with paths                            
['/home/jkirk/projects/python-dev/git-xl/src'] 
[...]
2598 INFO: checking PKG
2598 INFO: Building because toc changed
2598 INFO: Building PKG (CArchive) git-xl-x64.pkg
4750 INFO: Building PKG (CArchive) git-xl-x64.pkg completed successfully.
4750 INFO: Bootloader /home/jkirk/projects/python-dev/git-xl/venv3/lib/python3.11/site-packages/PyInstaller/bootloader/Linux-64bit-intel/run
4750 INFO: checking EXE
4751 INFO: Building because toc changed
4751 INFO: Building EXE from EXE-00.toc
4751 INFO: Copying bootloader EXE to /home/jkirk/projects/python-dev/git-xl/dist/git-xl-x64
4752 INFO: Appending PKG archive to custom ELF section in EXE
4763 INFO: Building EXE from EXE-00.toc completed successfully.
scripts/linux/build  13,22s user 0,57s system 98% cpu 13,928 total

And ./git-xl-x64 runs:

 ❯ ./git-xl-x64 --help
git-xl/0.0.0 (windows; Python 3.11.2); git dev
git xl <command> [<args>]

Git xl is a system for managing Excel workbook files in
association with a Git repository. Git xl:
* installs a special git-diff for Excel workbook files 
* makes Git ignore temporary Excel files via .gitignore

Commands
--------

* git xl env:
    Display the Git xl environment.
* git xl version:
    Report the version number.
* git xl install:
    Install Git xl.
* git xl uninstall:
    Uninstall Git xl.

But there are still things to do, to make it work and close #39. Until then, I mark this as [WIP].

jkirk added 2 commits January 30, 2024 11:02
scripts/linux/build is a modified version of scripts/windows/build.bat.

It just takes the modified ./scripts/linux/update-version-info.py + the
unmodified ./scripts/windows/git-xl-version-info.py files and uses them
to build the binary via pyinstaller.
To fix the following error:

  ❯ pip install -r requirements.txt
  Collecting colorama==0.3.9
    Using cached colorama-0.3.9-py2.py3-none-any.whl (20 kB)
  Collecting oletools==0.60
    Using cached oletools-0.60-py2.py3-none-any.whl (968 kB)
  ERROR: Ignored the following versions that require a different python version: 4.10 Requires-Python <3.11,>=3.6; 4.6 Requires-Python <3.11,>=3.6; 4.7 Requires-Python <3.11,>=3.6; 4.8 Requires-Python <3.11,>=3.6; 4.9 Requires-Python <3.11,>=3.6; 5.0 Requires-Python <3.11,>=3.7; 5.0.1 Requires-Python <3.11,>=3.7; 5.1 Requires-Python <3.11,>=3.7; 5.2 Requires-Python <3.11,>=3.7; 5.3 Requires-Python <3.11,>=3.7; 5.4 Requires-Python <3.11,>=3.7; 5.4.1 Requires-Python <3.11,>=3.7
  ERROR: Could not find a version that satisfies the requirement pyinstaller==4.10 (from versions: 2.0, 2.1, 3.0, 3.1, 3.1.1, 3.2, 3.2.1, 3.3, 3.3.1, 3.4, 3.5, 3.6, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.5.1, 5.5, 5.6, 5.6.1, 5.6.2, 5.7.0, 5.8.0, 5.9.0, 5.10.0, 5.10.1, 5.11.0, 5.12.0, 5.13.0, 5.13.1, 5.13.2, 6.0.0, 6.1.0, 6.2.0, 6.3.0)
  ERROR: No matching distribution found for pyinstaller==4.10
@jkirk jkirk mentioned this pull request Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add Linux support
1 participant