Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,28 @@ addons:
# GUI
- python3

install: |
before_install: |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew install gettext
brew link --force gettext
brew install intltool
brew install python3
fi

script:
install:
- ./bootstrap
- mkdir "$TRAVIS_BUILD_DIR/root"
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
./configure --enable-drm --enable-vidmode --enable-randr --enable-geoclue2 --enable-gui
./configure --prefix="$TRAVIS_BUILD_DIR/root" --enable-drm --enable-vidmode --enable-randr --enable-geoclue2 --enable-gui
elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
./configure --enable-corelocation --enable-quartz --enable-gui
./configure --prefix="$TRAVIS_BUILD_DIR/root" --enable-corelocation --enable-quartz --enable-gui
fi
- make -j2 install
- make -j2 distcheck

script:
- |
"$TRAVIS_BUILD_DIR"/root/bin/redshift -l 12:-34 -pv
- |
"$TRAVIS_BUILD_DIR"/root/bin/redshift -l 12:-34 -m dummy -vo
5 changes: 5 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ build_script:
- C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER && make distcheck DISTCHECK_CONFIGURE_FLAGS=\"$CONFIGURE_FLAGS\""
- C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER && make install"

test_script:
- |
%APPVEYOR_BUILD_FOLDER%\root\bin\redshift.exe -l 12:-34 -pv
%APPVEYOR_BUILD_FOLDER%\root\bin\redshift.exe -l 12:-34 -m dummy -vo

after_build:
- ps: |
$ZIP_NAME = "redshift-windows-$env:arch"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ AC_ARG_ENABLE([corelocation], [AC_HELP_STRING([--enable-corelocation],
AS_IF([test "x$enable_corelocation" != xno], [
AS_IF([test "x$have_corelocation_h" = xyes], [
CORELOCATION_CFLAGS=""
CORELOCATION_LIBS="-framework Foundation -framework CoreLocation"
CORELOCATION_LIBS="-framework Foundation -framework Cocoa -framework CoreLocation"
AC_DEFINE([ENABLE_CORELOCATION], 1,
[Define to 1 to enable CoreLocation provider])
AC_MSG_RESULT([yes])
Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ redshift_SOURCES = \
gamma-dummy.c gamma-dummy.h \
hooks.c hooks.h \
location-manual.c location-manual.h \
pipeutils.c pipeutils.h \
redshift.c redshift.h \
signals.c signals.h \
solar.c solar.h \
Expand Down
34 changes: 25 additions & 9 deletions src/location-corelocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with Redshift. If not, see <http://www.gnu.org/licenses/>.

Copyright (c) 2014 Jon Lund Steffense <jonlst@gmail.com>
Copyright (c) 2014-2017 Jon Lund Steffense <jonlst@gmail.com>
*/

#ifndef REDSHIFT_LOCATION_CORELOCATION_H
Expand All @@ -24,17 +24,33 @@

#include "redshift.h"

typedef struct location_corelocation_private location_corelocation_private_t;

int location_corelocation_init(void *state);
int location_corelocation_start(void *state);
void location_corelocation_free(void *state);
typedef struct {
location_corelocation_private_t *private;
int pipe_fd_read;
int pipe_fd_write;
int available;
int error;
float latitude;
float longitude;
} location_corelocation_state_t;

void location_corelocation_print_help(FILE *f);
int location_corelocation_set_option(void *state,
const char *key, const char *value);

int location_corelocation_get_location(void *state,
location_t *location);
int location_corelocation_init(location_corelocation_state_t *state);
int location_corelocation_start(location_corelocation_state_t *state);
void location_corelocation_free(location_corelocation_state_t *state);

void location_corelocation_print_help(FILE *f);
int location_corelocation_set_option(
location_corelocation_state_t *state,
const char *key, const char *value);

int location_corelocation_get_fd(
location_corelocation_state_t *state);
int location_corelocation_handle(
location_corelocation_state_t *state,
location_t *location, int *available);


#endif /* ! REDSHIFT_LOCATION_CORELOCATION_H */
Loading