Package: libglew-dev
Version: 2.3.1-5
Followup-For: Bug #1132634
Control: reopen -1

Hi Carsten,

Have you by chance read any of my comments before deciding to close the
bug? I understand the kicad devs found a workaround, but that doesn't
mean the problem I've described in my comments went away.

Here is a minimal example that demonstrates the problem with the
current libglew-dev package:

1. Install minimal Debian sid chroot. Inside chroot:

2. Run: apt install --no-install-recommends build-essential cmake libglew-dev

3. Create CMakeLists.txt with the following contents:
```
cmake_minimum_required(VERSION 3.11)
project(glew_example)

find_package(GLEW REQUIRED)
find_package(OpenGL REQUIRED)

add_executable(glew_example main.c)
target_link_libraries(glew_example GLEW::GLEW OpenGL::GL)
```

4. Create main.c with the following contents:
```
#include <GL/glew.h>
#include <stdio.h>

int main(void)
{
    printf("GLEW version: %s\n", glewGetString(GLEW_VERSION));
    return 0;
}
```

5. Run: cmake -S . -B build
```
-- The C compiler identification is GNU 15.2.0
-- The CXX compiler identification is GNU 15.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GLEW: /usr/lib/x86_64-linux-gnu/cmake/glew/glew-config.cmake
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Configuring done (0.7s)
-- Generating done (0.0s)
-- Build files have been written to: /build/reproducible-path/build
```

6. Run: cmake --build build
```
[ 50%] Building C object CMakeFiles/glew_example.dir/main.c.o
gmake[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libXext.so', 
needed by 'glew_example'.  Stop.
gmake[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/glew_example.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
```

As you can see, I am not doing anything with X11, yet I am required to
link against libXext?

I've already attached patches that fix the problem. It only requires
someone to apply them and release new version of the package.

With these patches you get:

7. Run: apt install ./libglew2.3_2.3.1-5.1_amd64.deb 
./libglew-dev_2.3.1-5.1_amd64.deb

8. Run: cmake -S . -B build
```
-- The C compiler identification is GNU 15.2.0
-- The CXX compiler identification is GNU 15.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GLEW: /usr/lib/x86_64-linux-gnu/cmake/glew/glew-config.cmake
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Configuring done (1.7s)
-- Generating done (0.0s)
-- Build files have been written to: /build/reproducible-path/build
```

9. Run: cmake --build build
```
[ 50%] Building C object CMakeFiles/glew_example.dir/main.c.o
[100%] Linking C executable glew_example
[100%] Built target glew_example
```

10. Run: ./build/glew_example
```
GLEW version: 2.3.1
```

Dimo

Reply via email to