wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.21k stars 509 forks source link

Is it possible to create wheel from actual master branch? #2534

Closed decodeais closed 2 months ago

decodeais commented 2 months ago

Distributor ID: Linuxmint Description: Linux Mint 21 Python 3.11.5 wxPython-4.2.2a1-cp311-cp311-linux_x86_64.whl

I made a little pull request, you accepted and merged. I wanted to test it. I tried to build a wheel but I allways get this error message:

checking for GTK+ - version >= 3.0.0... no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occurred. This usually means GTK+ is incorrectly installed.
configure: error: 
The development files for GTK+ were not found. For GTK+ 2, please
ensure that pkg-config is in the path and that gtk+-2.0.pc is
installed. For GTK+ 1.2 please check that gtk-config is in the path,
and that the version is 1.2.3 or above. Also check that the
libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
--libs' are in the LD_LIBRARY_PATH or equivalent.`

I used this script:

#!/bin/bash

# Update package lists
sudo apt-get update

# Install required packages
sudo apt install -y dpkg-dev build-essential python3-dev freeglut3-dev libgl1-mesa-dev \
libglu1-mesa-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libjpeg-dev libnotify-dev \
libpng-dev libsdl2-dev libsm-dev libtiff-dev libwebkit2gtk-4.0-dev libxtst-dev \
libgstreamer1.0-dev libjpeg-dev libtiff-dev libsm-dev

# Create directory for building
mkdir -p ~/WheelBuild

# Change directory to the build directory
cd ~/WheelBuild

# Create and activate virtual environment
python3 -m venv WheelBuilder_py
source WheelBuilder_py/bin/activate

# Upgrade pip and install required Python packages
pip install -U pip six wheel setuptools sip requests

# Clone wxPython repository
git clone https://github.com/wxWidgets/Phoenix.git --branch master
cd Phoenix
git submodule init
git submodule update
git submodule update --init --recursive

# Build wxPython wheel
python build.py build bdist_wheel

Can you give me a hint. I have searched everywhere. May be it is a stupid mistake or its impossible now. In this case I would have to wait for your next release.

swt2c commented 2 months ago

What you're doing seems like it should work. The build process is looking for files that are installed by libgtk-3-dev and you seem to have that installed. You'll have to check config.log like the error message says, to see what might be going wrong.

decodeais commented 2 months ago

I only get a 3 MB short form Wheel with the Python part. I have used this script on a raspberry too, with the same result.

Metallicow commented 2 months ago

Answer: Technically you could create a wheel file(pre-built binary package format) for any branch any where, if you spent the time to do diagnostics on it(object). You just might have to do the work yourself....

Metallicow commented 2 months ago

For the record, The timed build of wxPy on RaspberryPi was like 11 hour-ish. Now you can build it yourself this way is preferred, but lets say I have 1million folks needing the wheel was like, umm ya I cannot do that. When I uploaded my rpy wheel to github it gave me some sort of bullshit that it could not do over 100MB upload 'If I Recall Correctly'(IIRC).

What I did was take the pre-built wheel and divide it with 7-zip into 2 separate files so I could bypass the GitHub upload limit. Besides this there is nothing different in the combined installed file, besides taking the time to recombine the two files.

Metallicow commented 2 months ago

I would +1 to Robin if he did this access for Qualified(NOT certified) OS Builds from select folks.

This is also a big problem why folks ask for Raspbian/etc any other linux distro. There are NO Dedicated builders. Point said.

decodeais commented 2 months ago

In this moment I succeeded to build one wheel. Firrst I tried on Linux MInt, then on Raspian and than I tried with another Linux PC with Python3.10. Now I see the script is ok, a have only to upgrade python now.

Metallicow commented 2 months ago

My best advice to you as a linux user is to record your build info/steps somewhere as I cannot do this myself(maybe a github repo), and it will help you more and others in the future if you do. Some folks are dumbasses and forget everything. These short notes should guide them thru that process again... hopefully :)

decodeais commented 2 months ago

I am such a dumbasses, so I do everything by script. If it works I will give the script to the people i try to help now. I hope I get it working.

Metallicow commented 2 months ago

My reply is that scripts help most people on the C/C++ to get thing working. I've used Python for years, and don't recall any situation where a noob might have be called a "dumbass". Don't take this as an insult, It most times means the user is new and doesn't quite understand the logic or command.

You are tying well so far and haven't resulted in any weird failures yet. Acually building the Wheel is sometimes the hardest part. Document your 'build commands'

By the way, Python isn't a scripting language completely, it is a COMMAND Language. See MicroPython differences,

A script is like me telling you a comedy, or an idiom. A command is like me telling you to go to war. You just do it. But the choice is yours.

decodeais commented 2 months ago

This script worked for me. You are right, the interpreter has so much interaction with the OS that it could not be safe,but it may be a good starting point for pc and raspi:

#!/bin/bash
# export PATH="$HOME/.local/bin:$PATH"

export DOXYGEN=/usr/bin/doxygen # for Raspian we must use the internal dxygen
# Update package lists
sudo apt-get update
sudo apt install doxygen

sudo apt install -y dpkg-dev build-essential python3-dev freeglut3-dev libgl1-mesa-dev \
libglu1-mesa-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libjpeg-dev libnotify-dev \
libpng-dev libsdl2-dev libsm-dev libtiff-dev libwebkit2gtk-4.0-dev libxtst-dev \
libgstreamer1.0-dev libjpeg-dev libtiff-dev libsm-dev

# Create directory for building
mkdir -p ~/WheelBuild311

# Change directory to the build directory
cd ~/WheelBuild311

# Create and activate virtual environment
python3.11 -m venv WheelBuilder311_py
source ~/WheelBuild311/WheelBuilder311_py/bin/activate

#python3.11 -m venv myenv311

# Upgrade pip and install required Python packages
pip install -U pip six wheel setuptools sip requests

# Clone Phoenix repository
git clone https://github.com/wxWidgets/Phoenix.git --branch master
cd Phoenix
git submodule init
git submodule update
git submodule update --init --recursive

# Build Phoenix
python build.py dox etg --nodoc sip build bdist_wheel
#python build.py build bdist_wheel